This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Amber.Yust, Andreas.Pelme, Lakin.Wecker, belopolsky, cvrebert, dstufft, eric.araujo, georg.brandl, gwrtheyrn, lemburg, ncoghlan, pitrou, r.david.murray, shai, tim.peters, yselivanov
Date 2014-03-06.12:26:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394108801.1.0.725033736561.issue13936@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-03-06 12:26:41ncoghlansetrecipients: + 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:41ncoghlansetmessageid: <1394108801.1.0.725033736561.issue13936@psf.upfronthosting.co.za>
2014-03-06 12:26:41ncoghlanlinkissue13936 messages
2014-03-06 12:26:40ncoghlancreate