News for hackers. Stuff that matters.
Re:Python 3.5 to Ship with Matrix Multiplication Operator by dragonwriter on Tuesday April 08, 2014 @11:04AM (#7553828)
> You've got to wonder, does matrix multiplication happen so often and is it so inconvenient to call as a function that it's worth complicating the syntax?

It is empirically observed (and the identified rationale for this PEP) that matrix multiplication is done by overloading existing operators in popular Python libraries (going so far in Numpy as to have separate types differing primarily in whether the * operator does matrix or elementwise multiplication), and that this causes confusion, API fragmentation, and inefficiency, so, yes, it happens enough and is inconvenient enough that a general solution for doing it as an operator that doesn't interfere with existing operators is desirable.

Its not really "complicating the syntax", its just adding two new operators and corresponding magic methods, the structure of the syntax is unchanged, and these operators work just like other python operators, including their relationship to their corresponding magic methods.

Really, you should read the PEP (Python Enhancement Proposal) that is the linked article. It covers your question in great depth.

There are no comments on this comment yet.