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

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Mar 6 08:40:24 CET 2014


On Thu, Mar 6, 2014 at 2:30 AM, Donald Stufft <donald at stufft.io> wrote:

> It’s not reasonable to expect that midnight will evaluate
> to false, ..
>

Only in the world where it is not reasonable to expect programmers to read
library documentation.  In my world it is reasonable to expect that the
behavior that was documented in 10 major versions and for 10 years can be
relied on.



> especially when it doesn’t if you happen to have a tzinfo on the time
> (sometimes!).
>

As long as tzinfo specifies a fixed offset, there is no problem with the
current definition.  If you are unfortunate enough to live in a place with
semi-annual DST adjustment, aware time objects are problematic for reasons
that have nothing to do with the discussion at hand.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140306/b7d44ebd/attachment.html>


More information about the Python-ideas mailing list