Proto-PEP: Overloadable Boolean Operators

greg greg at cosc.canterbury.ac.nz
Sun Sep 5 21:24:44 EDT 2004


Miki Tebeka wrote:
> 
> Why not just __bool__(self) -> True, False?
> IMO this will answer all of your needs and will require less changes.

Have you read any of the rationale in the PEP?
The whole reason for this is that overriding __bool__
is *not* sufficient for the use cases I have
in mind.

Greg




More information about the Python-list mailing list