[SciPy-User] Matrix multiplication operator PEP

Sturla Molden sturla.molden at gmail.com
Sat Feb 22 21:57:57 EST 2014


Nathaniel Smith <njs at pobox.com> wrote:

> Subclassing is likely to be the major counter-argument, so make sure you
> shoot it down thoroughly.
> 
> My question is what counterargument are you referring to when you say
> "subclassing" :-). Is it the "you should just have both np.matrix and np.ndarray" argument?
>

Yes, exactly that, but perhaps from a more a more principal point of view:
That subclassing and overloading the operator in a subclass is the more
"pythonic" way to change the behavior of an operator. Whereas adding more
syntactic bloat is unpythonic. So we have to explain why subclassing and
operator overloading is insufficient. 

Sturla




More information about the SciPy-User mailing list