张佩佩 writes: > If we can overloading these operators, why we can't overloading > other operators? (like .* often used in matrix, U in set > operation)
AIUI, it's considered unpythonic. Operators are considered to be part of the *syntax* of Python, unlike Haskell, where infix syntax can be used for any function, and operators can be called via function syntax. (The latter is true in Python as well, but it is very bad form to do that, sufficiently verbose that it is hardly tempting, and it can easily fail because Python operators are polymorphic, but the implementations via class methods are not.) I'm sure it also simplifies parsing. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com