[Datetime-SIG] PEP 495 (Local Time Disambiguation) is ready for pronouncement

Tim Peters tim.peters at gmail.com
Tue Aug 18 18:30:25 CEST 2015


[Guido]
>> Proposal: name the flag 'fold', reverse it's sense, and be done with it
>> (then move on to PEP 500). So fold defaults to False.

[Alexander]
> I like "fold".  It is short, uses the word from the problem domain

I suppose I'm being dense, but what does fold=True mean?  Clearly it
means "this is an ambiguous time" - but _which_ one is intended?  The
earlier or the later?


> and I think the ascii-art below can serve as the mnemonic:
>
>         fold=True
>           +---+
>            \  |
>             \ |
> fold=False   \| fold=False
> ------------->+-----------

Same question, alas - I don't see what the diagram is trying to tell
me, apart from that there's some kind of 2-to-1 relationship.

>From Guido's "reverse its sense" I'm guessing fold=True means "this is
the later of two ambiguous times", but there's nothing in the word
"fold" on its own to suggest that.  It's only a deduction from knowing
what first=True meant before (the earlier of two ambiguous times)
coupled with "reverse its sense".

Or does fold=True mean something else?

Related:  would people have been happier with the obvious "first" if
it had been named "_first" instead?  For the most part it's an
attribute intended to be set "by magic" by various timezone
operations, not something most users need to know anything about
(indeed, for most users it would qualify as an "attractive nuisance").


More information about the Datetime-SIG mailing list