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

Antoine Pitrou solipsis at pitrou.net
Sat Mar 15 00:50:32 CET 2014


On Sat, 15 Mar 2014 12:41:23 +1300
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 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.

It depends how the vectors are layed out (horizontal @ vertical or
vertical @ horizontal).

Regards

Antoine.




More information about the Python-ideas mailing list