Author shai
Recipients Lakin.Wecker, belopolsky, eric.araujo, georg.brandl, gwrtheyrn, lemburg, r.david.murray, shai, tim.peters
Date 2014-03-04.17:41:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1393954902.93.0.797477758485.issue13936@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-03-04 17:41:43shaisetrecipients: + shai, lemburg, tim.peters, georg.brandl, belopolsky, eric.araujo, r.david.murray, gwrtheyrn, Lakin.Wecker
2014-03-04 17:41:42shaisetmessageid: <1393954902.93.0.797477758485.issue13936@psf.upfronthosting.co.za>
2014-03-04 17:41:42shailinkissue13936 messages
2014-03-04 17:41:42shaicreate