[Python-3000] __nonzero__ vs. __bool__
Guido van Rossum
guido at python.org
Tue Nov 21 02:21:10 CET 2006
Looks about right. Patch?
On 11/20/06, tomer filiba <tomerfiliba at gmail.com> wrote:
> how about changing the name of __nonzero__ to __bool__?
> today it looks like:
> * int(x) --> x.__int__()
> * long(x) --> x.__long__()
> * float(x) --> x.__float__()
> * str(x) --> x.__str__()
> but for bool it's x.__nonzero__()
> i'd guess __nonzero__ existed even before the bool type was introduced
> but in the cleanup-old-design-issues spirit, perhaps it can be made
> to the other builtin types.
> Python-3000 mailing list
> Python-3000 at python.org
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000