Message213434
This behavior conflicts with the other major classes, datetime.date and datetime.datetime. The ostensible reason for this falsy behavior is that midnight represents a fundamental zero point. We should expect to see similar zero points that evaluate to False for the other two classes. However, they do not include such falsy behavior.
In [2]: bool(datetime.datetime(datetime.MINYEAR, 1, 1))
Out[2]: True
In [3]: bool(datetime.date(datetime.MINYEAR, 1, 1))
Out[3]: True
Why don't these classes have any sense of zero at their minimums?
datetime.time.__bool__ should be dropped if for nothing more than consistency. |
|
Date |
User |
Action |
Args |
2014-03-13 18:31:36 | fandingo | set | recipients:
+ fandingo, lemburg, tim.peters, skip.montanaro, georg.brandl, mark.dickinson, ncoghlan, belopolsky, pitrou, eric.araujo, alex, r.david.murray, cvrebert, Alexander.Belopolsky, BreamoreBoy, ethan.furman, westley.martinez, gwrtheyrn, Lakin.Wecker, yselivanov, shai, dstufft, Andreas.Pelme, Amber.Yust, Hanxue.Lee |
2014-03-13 18:31:36 | fandingo | set | messageid: <1394735496.32.0.0288186322944.issue13936@psf.upfronthosting.co.za> |
2014-03-13 18:31:36 | fandingo | link | issue13936 messages |
2014-03-13 18:31:35 | fandingo | create | |
|