<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 19, 2015 at 1:25 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Rather than prolonging the debate, let me just reject PEP 500.</blockquote></div><br>That is certainly within your powers, but before you do, let me substantiate my claim about 10x performance penalty.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">$ python3 -m timeit -s "from datetime import datetime, timezone; t = datetime.now(timezone.utc); l = t.astimezone()" "l - t"</div><div class="gmail_extra">1000000 loops, best of 3: 0.448 usec per loop</div><div class="gmail_extra"><div class="gmail_extra">$ python3 -m timeit -s "from datetime import datetime, timezone; t = datetime.now(); l = t" "l - t"</div><div class="gmail_extra">10000000 loops, best of 3: 0.0444 usec per loop</div><div class="gmail_extra"><br></div><div class="gmail_extra">Currently, subtracting aware datetimes with the same tzinfo incurs no penalty</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">$ python3 -m timeit -s "from datetime import datetime, timezone; t = datetime.now(timezone.utc); l = t" "l - t"</div><div class="gmail_extra">10000000 loops, best of 3: 0.0436 usec per loop</div><div class="gmail_extra"><br></div><div class="gmail_extra">With PEP 500, we can have timeline arithmetic without the overhead of two round trips to tzinfo.   I will be happy if someone would demonstrate how to achieve the same by simpler means.</div></div></div></div></div>