I don't understand why you think subclassing has anything to do with this. You write "X so Y", but in fact X (`np.matrix` subclasses `np.ndarray`) and Y (code that expects an `ndarray` gets a `matrix`) are logically unrelated. Passing in scipy.sparse matrices to code expecting an ndarray won't work either.