user-defined operators: a very modest proposal
Steve R. Hastings
steveha at localhost.localdomain
Tue Nov 22 18:44:23 EST 2005
> Here is a thought: Python already supports an unlimited number of
> operators, if you write them in prefix notation:
And indeed, so far Python hasn't added user-defined operators because this
has been adequate.
> Here is some syntax that I don't object to, although that's not saying
> much.
> m0(+)m1
That form was discussed previously, as were "[+]", "<+>", etc. The
favorite was "{+}". I believe such forms were considered hard to tell
from code. In particular, m0(+) looks like a function call.
See the PEP:
http://www.python.org/peps/pep-0225.html
Alas, the links to the discussion about this don't work. But it is
possible to use the Google Groups archive of comp.lang.python to read some
of the discussion.
--
Steve R. Hastings "Vita est"
steve at hastings.org http://www.blarg.net/~steveha
More information about the Python-list
mailing list