Proto-PEP: Overloadable Boolean Operators
Miki Tebeka
miki.tebeka at zoran.com
Sun Sep 5 12:17:29 EDT 2004
Hello greg,
> PEP ??? - Overloadable Boolean Operators
> ========================================
> <snip>
> Unary: __not__(self)
>
> Binary, phase 1: __and1__(self) __or1__(self)
>
> Binary, phase 2: __and2__(self, other) __or2__(self, other)
> __rand2__(self, other) __ror2__(self, other)
>
> <snip>
Why not just __bool__(self) -> True, False?
IMO this will answer all of your needs and will require less changes.
Bye.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
http://tebeka.spymac.net
The only difference between children and adults is the price of the toys
More information about the Python-list
mailing list