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

Tim Peters tim.peters at gmail.com
Thu Mar 6 02:37:37 CET 2014


[Paul Moore]
>> """in Boolean contexts, a time object is considered to be true if and
>> only if, after converting it to minutes and subtracting utcoffset()
>> (or 0 if that's None), the result is non-zero."""

[Greg Ewing]
> Aaaaargh... I didn't know this had since been documented.
>
> Wy opinion still stands -- documenting this was the
> wrong thing to do. I hope it can still be fixed.

The quoted text has always been there, from datetime's initial release:

    http://docs.python.org/2.3/lib/datetime-time.html

That was a bit over 9 years ago.


More information about the Python-ideas mailing list