<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 2, 2015 at 1:20 PM, Tim Peters <span dir="ltr"><<a href="mailto:tim.peters@gmail.com" target="_blank">tim.peters@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":26f" class="" style="overflow:hidden">[Alex]<br>
<span class="">> There are two more cases:<br>
><br>
> (1) datetime.now() will return fold=1 instances during one hour each year;<br>
> (2) datetime.fromtimestamp(s) will return fold=1 instances for some values<br>
> of s.<br>
<br>
</span>Sure - but anything reflecting how a local clock actually behaves is<br>
outside of "naive time".  Clocks in naive time never jump forward or<br>
backward.  Specifically, .now() and .fromtimestamp() are also<br>
operations outside of naive time.</div></blockquote></div><br>I agree, but the worst thing we can do to our users is to plant a time bomb that will go off once a year.  Suppose someone has a program that uses naive local times and relies on t < prev_t test to detect the fall-back fold and do something about it.  If we don't ignore fold in naive datetime comparisons - this program will start producing incorrect results.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Fortunately, we don't need to do anything about naive times.  The hash invariant is only violated by aware instances.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I think what you are really fighting against is the notion that for regular times, fold=1 is just an alternative spelling for fold=0 times.  It looks like you would rather see fold=1 as some different (and invalid) time.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Think of the German A and B hours: are regular hours A or B?  The German standard say that they are neither, but PEP 495 say that they are both: 2A is the same as 2B  unless "2" in the fold and that allows you not to display A/B in those cases.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Folds do not exist in naive time, so all times are regular and therefore time(h, m, s, us,  fold=0) == time(h, m, s, us,  fold=1) always. </div></div>