Message212807
I wrote up a longer post on python-ideas regarding the problems that the current behaviour poses when it comes to inferring a correct mental model for datetime.time(): https://mail.python.org/pipermail/python-ideas/2014-March/026647.html
As part of that, it's also worth noting the current behaviour in boolean context is effectively shorthand for:
import datetime as dt
naivemidnight = dt.time(0, 0)
utcmidnight = dt.time(0, 0, tzinfo=dt.timezone.utc
if x in (naivemidnight, utcmidnight):
...
So if the current boolean behaviour is deprecated and removed, it is easily reproduced through equality checks.
It may also make sense to offer an API to easily calculate seconds since midnight, but that would be a separate issue. |
|
Date |
User |
Action |
Args |
2014-03-06 12:26:41 | ncoghlan | set | recipients:
+ ncoghlan, lemburg, tim.peters, georg.brandl, belopolsky, pitrou, eric.araujo, r.david.murray, cvrebert, gwrtheyrn, Lakin.Wecker, yselivanov, shai, dstufft, Andreas.Pelme, Amber.Yust |
2014-03-06 12:26:41 | ncoghlan | set | messageid: <1394108801.1.0.725033736561.issue13936@psf.upfronthosting.co.za> |
2014-03-06 12:26:41 | ncoghlan | link | issue13936 messages |
2014-03-06 12:26:40 | ncoghlan | create | |
|