Message213434
| Author |
fandingo |
| Recipients |
Alexander.Belopolsky, Amber.Yust, Andreas.Pelme, BreamoreBoy, Hanxue.Lee, Lakin.Wecker, alex, belopolsky, cvrebert, dstufft, eric.araujo, ethan.furman, fandingo, georg.brandl, gwrtheyrn, lemburg, mark.dickinson, ncoghlan, pitrou, r.david.murray, shai, skip.montanaro, tim.peters, westley.martinez, yselivanov |
| Date |
2014年03月13日.18:31:35 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1394735496.32.0.0288186322944.issue13936@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|