[Python-Dev] PEP 465: A dedicated infix operator for matrix multiplication

Victor Stinner victor.stinner at gmail.com
Mon Apr 7 22:38:03 CEST 2014


Hi,

2014-04-07 3:41 GMT+02:00 Nathaniel Smith <njs at pobox.com>:
> So, I guess as far as I'm concerned, this is ready to go. Feedback welcome:
>   http://legacy.python.org/dev/peps/pep-0465/

I'm not convinced yet that there is enough usage of Python in
mathematical world to modify the Python language to add a new
operator. Python is used for a lot of different use cases, in a lot of
domains. I'm not sure that it's a good thing to modify the *language*
for a specific domain. But you can do a lot without modify the
language :-)

I'm a little bit surprised by the "Count of Python source files on
Github matching given search terms" table, it's very different from
these statistics:
http://python3wos.appspot.com/

Where are six, pytz,  mock, webob, etc. in your table? (all modules
which come before "numpy" in the "Python 3 Wall of Superpowers")

> But isn't it weird to add an operator with no stdlib uses?

I agree that it sounds weird :-) Maybe we should start by putting some
parts of numpy/scipy/sage/pylab/panda into the stdlib? (I'm not sure
that the new statistics module is such beginning.)

--

It would be nice to support A × B too, because it's much more
readable. You can configure a keyword to write arbitrary characters.
For example, on Linux you can write × using "Compose x x" if you
configured the Compose key. Or sometimes, you can replace "@" with "×"
using your favorite text editor (copy-paste from another script, from
a webpage, or something else).

You may mention Perl 6 meta operators, but it's not directly related:
http://en.wikibooks.org/wiki/Perl_6_Programming/Meta_Operators

Victor


More information about the Python-Dev mailing list