[issue13936] datetime.time(0, 0, 0) evaluates to False despite being a valid time

Lakin Wecker report at bugs.python.org
Fri Feb 3 21:55:11 CET 2012


Lakin Wecker <lakin.wecker at gmail.com> added the comment:

Right. I've updated my code to be more correct:

instead of:

if not start_time:
    start_time = default_time

it now reads:

if start_time is None:
    start_time = default_time

which operates correctly and works fine for my case, I just thought it was odd that one time out of all of them evaluates to False.  I too wonder if it's by design or not.

It's definitely not documented if it is by design.

----------

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


More information about the Python-bugs-list mailing list