<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 14, 2015 at 3:49 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=":1gn" class="" style="overflow:hidden"> It depends on how expensive .utcoffset()<br>
is, which in turn depends on how the tzinfo author implements it.</div></blockquote></div><br>No, it does not.  In most time zones, UTC offset in seconds can be computed by C code as a 4-byte integer faster than CPython can look up the .utcoffset method. (At least for times within a few years around now.) A programmer who makes it slower should be fired.  Yet I agree, <span style="font-size:12.8px"> </span><span style="font-size:12.8px">"'premature </span><span style="font-size:12.8px">optimization' applies at this time."</span></div></div>