Message212732
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. |
|
Date |
User |
Action |
Args |
2014-03-04 17:41:43 | shai | set | recipients:
+ shai, lemburg, tim.peters, georg.brandl, belopolsky, eric.araujo, r.david.murray, gwrtheyrn, Lakin.Wecker |
2014-03-04 17:41:42 | shai | set | messageid: <1393954902.93.0.797477758485.issue13936@psf.upfronthosting.co.za> |
2014-03-04 17:41:42 | shai | link | issue13936 messages |
2014-03-04 17:41:42 | shai | create | |
|