User defined operators

Alex Martelli aleax at aleax.it
Tue Feb 25 06:40:05 EST 2003


Turhan Ozen wrote:

> Why it is not allowed to create a new operator but only modify the
> existing ones?

The few languages that allow users to define new operators typically
need complicated infrastructure to allow precedence and associativity
of user-defined operators to be defined -- and the resulting programs
are often not any easier to read (to put it mildly) because of the
extra helping of syntax sugar.  Python is simpler, and programs in
Python easier to read, thanks to the surface-syntax being fixed, all
operator precedence and associativity carved in stone, and so on.


Alex





More information about the Python-list mailing list