3 ms·
Why not use the existing convention for names of infix operators like __mmul__ but allow then to be infix as well.. So, we could write A __mmul__ B. I think th
by mckoss 13y ago
Why not use the existing convention for names of infix operators like __mmul__ but allow then to be infix as well.. So, we could write A __mmul__ B.
I think this is more clear than @ and is already familiar to programmers that deal with operator overloading methods. It would also enable the addition of arbitrary infix operators to python.
- atlbeer 13y ago__ methods are private and not meant to be called outside of the class The @ decorator vs @ MMUL seems pretty syntactically clear though. @decorator() def function(): variable @ variable