[Numpy-discussion] deprecate numpy.matrix

Pauli Virtanen pav at iki.fi
Mon Feb 10 16:03:03 EST 2014


10.02.2014 22:23, Alan G Isaac kirjoitti:
[clip]
> As far as I have been able to discern, the underlying
> motivation for eliminating the matrix class is that
> some developers want to stop supporting in any form
> the subclassing of numpy arrays.  Do I have that right?

What sparked this discussion (on Github) is that it is not possible to
write duck-typed code that works correctly for:

- ndarrays
- matrices
- scipy.sparse sparse matrixes

The semantics of all three are different; scipy.sparse is somewhere
between matrices and ndarrays with some things working randomly like
matrices and others not.

With some hyberbole added, one could say that from the developer point
of view, np.matrix is doing and has already done evil just by existing,
by messing up the unstated rules of ndarray semantics in Python.

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list