use np.broadcast_arrays(). You get the additional benefit of making sure everything is broadcastable, so you can eliminate the shape check later