Shai Berger added the comment:

Just got bit by this.

Tim Peters said: """
It is odd, but really no odder than "zero values" of other types evaluating to 
false in Boolean contexts.
"""

I disagree. Midnight is not a "zero value", it is just a value. It does not 
have any special qualities analogous to those of 0, "", or the empty set. Time 
values cannot be added or multiplied. Midnight evaluting to false makes as much 
sense as date(1,1,1) -- the minimal valid date value -- evaluating to false 
(and it doesn't).

It makes perfect sense for timedelta(0) to evaluate to false, and it does. time 
is different.

Also, while I appreciate this will never be fixed for Python2, the same 
behavior exists in Python3, where there may still be room for improvement.

I second Danilo Bergen's request. Please reopen.

----------
nosy: +shai

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13936>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to