A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-April/139077.html below:

[Python-Dev] Status on PEP-431 Timezones

[Python-Dev] Status on PEP-431 TimezonesLennart Regebro regebro at gmail.com
Wed Apr 8 23:47:45 CEST 2015
On Wed, Apr 8, 2015 at 9:57 PM, Isaac Schwabacher <ischwabacher at wisc.edu> wrote:
> On 15-04-08, Lennart Regebro 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.
>
> Storing the offset itself instead of a flag makes things conceptually cleaner.

The concept would be pretty much the same, but yes, you would be able
to save lookups in the dst() call, so that's a benefit. I was planning
on storing the dst() offset at least lazily, but I'm not sure that
means we can get rid of the flag.

> As an added bonus, you get a representation that's still meaningful when time changes happen for political rather than DST reasons.

That's a good point. Although you would still have to use the is_dst
flag to choose in that case, even if neither or both is actually DST.
Unless we come up with another name for that flag, which I don't think
is important.

//Lennart
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4