<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 1, 2015 at 2:00 PM, Alexander Belopolsky <span dir="ltr"><<a href="mailto:alexander.belopolsky@gmail.com" target="_blank">alexander.belopolsky@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"><span class=""><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">And there's also that, after<br>
<br>
    d = dt1 - dt2<br>
<br>
I suspect it may no longer always be the case that<br>
<br>
    dt1 == dt2 + d<br>
<br>
(unsure, but can't make time for it now)<br></blockquote><div><br></div></span><div>That's the price we pay for classic arithmetic anyways.  </div></blockquote></div><br>Let me clarify what I mean by that:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">>>> from datetime import *</div><div class="gmail_extra">>>> exec(open("Doc/includes/tzinfo-examples.py").read())</div><div class="gmail_extra">>>> t1 = datetime(2015, 10, 31, 12, tzinfo=Eastern)</div><div class="gmail_extra">>>> t2 = datetime(2015, 11, 1, 12, tzinfo=Eastern)</div><div class="gmail_extra">>>> u = datetime(2000, 1, 1, tzinfo=timezone.utc)</div><div class="gmail_extra">>>> (t1 - u) - (t2 - u) == t2 - t1</div><div class="gmail_extra">False</div><div class="gmail_extra"><br></div><div class="gmail_extra">This is a fundamental property of classic arithmetic and the only way to prevent something like this from happening is (as Guido mentioned previously) to disallow cross-zone arithmetic.  This would be quite justifiable from the relativity POV: whether or not two events occur simultaneously at two different places depends on the speed of the observer.   This fact will be important when ordinary computers get clocks with nanosecond precision.  Meanwhile, our governments let us enjoy the effects relativity and time travel twice a year at pedestrian speeds: if you add a day in New York, go to Paris, subtract a day there and come back to New York you may not find yourself at the same time. </div></div><div class="gmail_extra"><br></div></div>