[Python-ideas] Infix matrix-multiply, but not general infix operators?

Ron Adam ron3200 at gmail.com
Thu Mar 20 21:14:35 CET 2014



On 03/20/2014 12:06 PM, Andrew Barnert wrote:
> Of course I still like my general infix proposal, but even if we had it, I think @ for matmul might be worth adding anyway.


I like that idea also, but ...

    s = 'a' 'b' 'c'

Is 'b' a string op or a string?


To make it work, it needs an introducer.  Which kind of defeats some of the 
advantage.


Or it needs to be defined with a keyword.  This actually makes sense as 
it's changes the effect of a name.  (like local, non-local, and global.)

   def foo(...):
      symbol b

      s = 'a' b 'c'

One of the objects would need a method to get the symbol, and the other 
argument.

Cheers,
    Ron



More information about the Python-ideas mailing list