[Datetime-SIG] PEP 495: What's left to resolve
alexander.belopolsky at gmail.com
Wed Sep 9 04:02:42 CEST 2015
On Tue, Sep 8, 2015 at 9:49 PM, Chris Angelico <rosuav at gmail.com> wrote:
> On Wed, Sep 9, 2015 at 5:45 AM, Alexander Belopolsky
> <alexander.belopolsky at gmail.com> wrote:
> > Definitions: An aware datetime value t is called "regular" if
> > does not depend on the value of the fold attribute.
> One point to clarify here. Is the definition of "regular" based on the
> timezone alone (that is to say, a UTC datetime is regular, and an
> Australia/Brisbane datetime is regular, but anything in a region with
> DST is always special), or are "special" datetimes only those in the
> fold period?
It is what the definition says. If you want to know whether t is regular
you have to compare t.utcoffset() and
t.replace(fold=1-t.fold).utcoffset(). If they are the same, t is regular.
If not - t is special. If tzinfo is a fixed offset timezone, all times
with such tzinfo are regular. If tzinfo is a typical DST observing
timezone, then times in the fold and in the gap are special and the rest
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Datetime-SIG