[Python-ideas] Fwd: [RFC] draft PEP: Dedicated infix operators for matrix multiplication and matrix power
Robert Kern
robert.kern at gmail.com
Thu Mar 20 11:32:33 CET 2014
On 2014-03-14 17:53, Guido van Rossum wrote:
> - Did you consider a duck-typing (is that the word?) attribute?
> E.g. a*b is elementwise multiplication; a.M*b must be used for
> matrix multiplication. (Your use of .T as "transpose" made me think
> of this.) Of course the question is, can you get those packages
> that currently use * for matrix multiply to comply? (I don't consider
> this a serious counter-proposal. But you list a bunch of rejected
> alternatives; this could be in that list.
Apparently this *was* considered in PEP 225 under "Alternatives to adding new
operators", numbers 3 and 4.
http://legacy.python.org/dev/peps/pep-0225/
Of course, number 6 is "Introducing a single operator, such as @, for matrix
multiplication." :-)
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-ideas
mailing list