[Python-ideas] bool(datetime.time(0, 0))

Greg Ewing greg.ewing at canterbury.ac.nz
Tue May 8 02:32:23 CEST 2012


M.-A. Lemburg wrote:
> In Python 3.x, nb_nonzero was renamed to nb_bool without really
> paying attention to the fact that many types implemented the original
> meaning instead of a notion of boolean value

I don't think it was wrong to do that. The fact that the
C slot was called "nonzero" was never visible to the Python
programmer, who always thought of the operation it represents
as truth-testing.

If there's any fault here, it's with C type implementors who
have taken "nonzero" too literally.

-- 
Greg



More information about the Python-ideas mailing list