[Python-Dev] Status on PEP-431 Timezones

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Apr 8 19:17:55 CEST 2015


On Wed, Apr 8, 2015 at 11:18 AM, Lennart Regebro <regebro at gmail.com> wrote:

> === Stdlib option 2: A datetime _is_dst flag ===
>
> By having a flag on the datetime instance that says "this is in DST or not"
> the timezone implementation can be kept simpler.
>

I floated this idea [1] back in the days when we discussed the
 datetime.timestamp() method.
The attraction was that such API would be familiar to the users of POSIX
mktime and struct tm,
but the history have shown that these POSIX APIs were insufficient in many
situations and
struct tm was extended by may libraries to include non-standard tm_gmtoff
and tm_zone fields.

With datetime, we also have a problem that POSIX APIs don't have to deal
with: local time
arithmetics.  What is t + timedelta(1) when t falls on the day before DST
change?  How would
you set the isdst flag in the result?

[1] http://bugs.python.org/issue2736#msg124237
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150408/e29ab959/attachment.html>


More information about the Python-Dev mailing list