A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20150923/35c9935d/attachment.html below:

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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=""><p dir="ltr">[Tim Peters]</p>
<p dir="ltr">><br>
> Guido's reply gave a clearer invariant:<br>
><br>
> Â  Â  dt.timestamp() ==<br>
> Â  Â  dt.astimezone(utc).timestamp() ==<br>
> Â  Â  dt.astimezone(<any other tz>).timestamp()<br></p></span>
<p dir="ltr"></p></blockquote><div>[ Nick Coghlan]</div><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"><p dir="ltr">Might it be worth mentioning Guido's invariant in the section of the PEP about the timestamp method?</p>
</blockquote></div>The case of missing time in Guido's invariant is rather subtle.  What is happening is that .timestamp() Â and .astimezone(..) methods use the same "normalization" to interpret what dt means.  This is not obvious in the expression above.  Particularly in dt.astimezone(<any other tz>).timestamp().  Here, if instead of <any other tz> we pass dt.tzinfo, then .astimezone(..) becomes a noop and "normalization" happens in .timestamp().  I don't think exposing all this in the PEP will help.  Let's return to this when it is time to write the reference documentation.</div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4