[Datetime-SIG] Another round on error-checking

Carl Meyer carl at oddbird.net
Thu Sep 3 17:19:22 CEST 2015

On 09/03/2015 09:02 AM, Alexander Belopolsky wrote:
> On Thu, Sep 3, 2015 at 10:52 AM, Carl Meyer <carl at oddbird.net
> <mailto:carl at oddbird.net>> wrote:
>     It is no longer true that "arithmetic within a timezone is always
>     naive."
> If you like this rule, you can keep it. :-)   Just note that fold=1
> instances are in a different timezone.

Ok, so for most of the year when I do utctime.astimezone(Eastern), I get
a result in Eastern, but during one hour of the year I get a result in
"some other timezone that isn't quite Eastern" (but its tzinfo is still
the same object as all the others). That's your proposal for a _less_
surprising interpretation? ;-)

>  This is unavoidable because
> within the same timezone fold=1 instances don't exist: 01:59 is followed
> by 02:00 with no room for "second 01:30" in between.

Right. That's an excellent statement of why respecting `fold` at all is
inconsistent with how tz-annotated datetimes are designed to behave in
Python (they operate internally in naive time, in which the "fold" time
does not even exist).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150903/ab0d8f29/attachment.sig>

More information about the Datetime-SIG mailing list