Re: [Python-Dev] PEP 495 accepted

2015-09-23 Thread Alexander Belopolsky
> > [Tim Peters] > > > > > Guido's reply gave a clearer invariant: > > > > dt.timestamp() == > > dt.astimezone(utc).timestamp() == > > dt.astimezone().timestamp() > > [ Nick Coghlan] > Might it be worth mentioning Guido's invariant in the section of the PEP > about the timestamp method

Re: [Python-Dev] PEP 495 accepted

2015-09-23 Thread Nick Coghlan
On 24 Sep 2015 01:21, "Tim Peters" wrote: > > Guido's reply gave a clearer invariant: > > dt.timestamp() == > dt.astimezone(utc).timestamp() == > dt.astimezone().timestamp() > > That's the key point. If the timestamps are equivalent, then it > follows that conversions to UTC are equi

Re: [Python-Dev] PEP 495 accepted

2015-09-23 Thread Tim Peters
[Nick Coghlan ] > ... > Sorry, what I wrote in the code wasn't what I wrote in the text, but I > didn't notice until Guido pointed out the discrepancy. To get the > right universal invariant, I should have normalised the LHS, not the > RHS: > > dt.astimezone(utc).astimezone(dt.tzinfo) == >