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

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Aug 18 20:41:52 CEST 2015


On Tue, Aug 18, 2015 at 2:22 PM, Carl Meyer <carl at oddbird.net> wrote:

> > I thought about this and my answer is that a "gap" is a negative "fold",
> > so in the fold you have t.replace(fold=True) - t.replace(fold=False) > 0
> > and in the gap - the opposite t.replace(fold=True) -
> > t.replace(fold=False) < 0.  While admittedly, this is an a posteriori
> > justification, it makes perfect sense to me.
>
> That's lovely :-)
>
> But I still think I could figure out whether to use later=True or
> later=False more easily than I could figure out whether to use fold=True
> or fold=False (in both cases really, but especially in the gap case).


I am not sure Raymod Hettinger is receiving these emails, so I added him to
"bcc".  It will be good to have an input from people with teaching
experience.  The problem with "hardcoding" the temporal relationship in the
name of the flag is that for a missing time `t` you get a counter-intuitive
t.replace(later=True) - t.replace(later=False) < 0.  On one hand, this
strongly suggests that something is wrong with `t`, but also invites a
question why not make this an error?  A "gap" is a negative "fold" rule may
not be much better in terms of teachability, but it is hard to judge it
without an actual teaching experience.


PEP link: https://www.python.org/dev/peps/pep-0495
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150818/7295a694/attachment.html>


More information about the Datetime-SIG mailing list