[Python-ideas] Please reconsider the Boolean evaluation of midnight

Antoine Pitrou solipsis at pitrou.net
Thu Mar 6 11:46:13 CET 2014


Le 06/03/2014 11:33, M.-A. Lemburg a écrit :
>
> I find it strange that the only argument against having time(0,0,0)
> evaluate to False in a boolean context is a wrongly used
> None test.

It's only "wrongly used" because of that particular wart.
In other words, the "wrongly used" None test *exposes* the wart, it is 
not its *cause*.

There are other contexts with implicit boolean conversion, such as any() 
and all().

Regards

Antoine.




More information about the Python-ideas mailing list