[Python-ideas] Please reconsider the Boolean evaluation of midnight

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Mar 6 18:11:33 CET 2014


On Thu, Mar 6, 2014 at 12:05 PM, Tim Peters <tim.peters at gmail.com> wrote:

> I'm not sure I did either!  An "aware" time object is a bizarre beast,
> and I've never used one outside of writing datetime test cases.  I'm
> not even sure why aware time objects exist - we'd have to dig into
> Guido's subconscious for that one ;-)
>

They are occasionally useful if you want to split datetimes into date and
time
parts, process those separately and recombine in the end without loosing
tzinfo.

I don't think anything involving time.utcoffset() makes much sense and it
is unfortunate
that time.utcoffset() can be invoked implicitly when aware time is used in
boolean context.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140306/7cd673a0/attachment.html>


More information about the Python-ideas mailing list