[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
> (2.2?),
> but in the cleanup-old-design-issues spirit, perhaps it can be made
> symmetrical
> to the other builtin types.
>
>
> -tomer
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe:
> http://mail.python.org/mailman/options/python-3000/guido%40python.org
>
>
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list