[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True

Alexander Belopolsky report at bugs.python.org
Thu Mar 6 03:30:25 CET 2014


Alexander Belopolsky added the comment:

> If Midnight is considered the last moment of the day then it
> evaluating to false makes even less sense since the rationale
> given is "time is seconds since midnight".

You are erecting a straw-man.  Python clearly considers time(0) to be the first moment of the day, not the last:

>>> time(0) < time(1)
True

It is my application that makes the opposite choice.  Helpfully, boolean property of time(0) makes it easy to write code that treats midnight as a special case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13936>
_______________________________________


More information about the Python-bugs-list mailing list