On 2/10/2014 5:11 PM, Pauli Virtanen wrote: > The existence of np.matrix messes up the general agreement on ndarray > semantics in Python. The meaning of very basic code such as > > A * B > A.sum(0) > A[0] > > where A and B are NxN matrices of some sort now depends on the types > of A and B. This makes writing duck typed code impossible when both > semantics are in play.
I'm just missing the point here; sorry. Why isn't the right approach to require that any object that wants to work with scipy can be called by `asarray` to guarantee the core semantics? (And the matrix object passes this test.) For some objects we can agree that `asarray` will coerce them. (E.g., lists.) I just do not see why scipy should care about the semantics an object uses for interacting with other objects of the same type. Alan Isaac _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion