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

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Mar 15 00:41:23 CET 2014


Steven D'Aprano wrote:
> I suppose because unconsciously I associated it with the common 
> shorthand implying (scalar) multiplication:
> 
>     5kg of apples @ $2 per kg costs $10.00

That analogy actually extends to the matrix case as well.
E.g. if you have a vector q of quantities and a vector
p of prices, then q @ p is the total price.

-- 
Greg


More information about the Python-ideas mailing list