[Python-ideas] Infix functions

Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Feb 23 16:50:35 CET 2014


On Sat, Feb 22, 2014 at 10:17 PM, Bruce Leban <bruce at leapyear.org> wrote:

> I'm not sure about enclosing the operator character in quotes. C++ and C#
> use an operator keyword, while Ruby doesn't mark it at all. Python, of
> course, uses __oper__ functions for overloading built-in operators.
> Writing __∩__ would complicate the tokenizer as it would have to
> recognize this exact syntax and treat it as an identifier while not
> allowing math symbol characters in other uses in an identifier.
>

What about __intersection__, __union__, etc.  It looks like all symbols of
interest have relatively short one-two word names in Unicode that can me
mechanically converted to dunder method names.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140223/674b18c9/attachment-0001.html>


More information about the Python-ideas mailing list