[Python-ideas] Non-boolean return from __contains__

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jul 27 08:33:28 CEST 2010


Guido van Rossum wrote:
> The other odd ducks are 'and' and 'or',

Well, I tried to do something about that with the Overloaded
Boolean Operators proposal, but it seems to have met with
a not-very-enthusiastic response.

Have you had any more thoughts about it? Do you think it's
a problem worth solving, or are '&' and '|' good enough?
Or would you rather see some completely different mechanism
introduced for getting parse trees from expressions, a la
LINQ?

> I forget in which camp 'not' falls.

If I remember correctly, it's not currently overridable
independently from __bool__, but there would be no
difficulty in making it so, because there is no control
flow involved.

-- 
Greg




More information about the Python-ideas mailing list