[Datetime-SIG] PEP 495 Q & A

Carl Meyer carl at oddbird.net
Tue Aug 25 02:34:50 CEST 2015

On 08/22/2015 08:20 PM, Tim Peters wrote:
> [Alexander Belopolsky]
>> ...
>> Note that I did not include all suggestions for the name of the flag, but I
>> thank everyone who made their suggestions.   I think we are really left with
>> two contenders: "fold" and "later."  The only additional variant I would
>> like to consider is "fold" with the integer values of 0 and 1.  I think
>> time(1, 30, fold=1) is short and sweet and looks better than time(1, 30,
>> later=True).
>> Note that neither spelling is self-explanatory, particularly if you see
>> something like if dt.replace(later=True) < dt.replace(later=False) in
>> someone's code, but the word "fold" points you in the right direction and is
>> more Google-friendly than "later".
>> The reason I think fold=0 and fold=1 may work better than booleans, is that
>> you can think of the local time line as consisting of two "folds" one - the
>> main timeline and the other a discontinuous line covering the fall-back
>> hours.
> I'm on board with fold=0 and fold=1.  I only hated "fold" when it was
> False and True.  Now we're indexing a theoretically unbounded sequence
> of folds by an ordinal, which makes perfect sense - the later the
> time, the larger the ordinal ;-)

That's ok by me. It seems wrong to use `fold` to decide which side of a
gap to choose, too -- but it's even more wrong to use `first` or `later`
when they actually mean the reverse when disambiguating a gap. So I'll
go with your explanation that a gap is a "negative fold" and be happy :-)


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

More information about the Datetime-SIG mailing list