[Python-ideas] Fwd: [RFC] draft PEP: Dedicated infix operators for matrix multiplication and matrix power

Steven D'Aprano steve at pearwood.info
Fri Mar 14 23:48:12 CET 2014


On Fri, Mar 14, 2014 at 01:59:14AM +0000, Nathaniel Smith wrote:

> This PEP proposes two new binary operators dedicated to matrix
> multiplication and matrix power, spelled ``@`` and ``@@``
> respectively.  (Mnemonic: ``@`` is ``*`` for mATrices.)

When I first started reading the PEP, I was rather dubious about the 
choice of @ as operator, but it surprised me at how quickly I got used 
to it. I suppose because unconsciously I associated it with the common 
shorthand implying (scalar) multiplication:

    5kg of apples @ $2 per kg costs $10.00

so it didn't take me very long to warm to it.

+1


-- 
Steven



More information about the Python-ideas mailing list