On Wed, Apr 8, 2015 at 11:18 AM, Lennart Regebro <rege...@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
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com