[Datetime-SIG] Are there any "correct" implementations of tzinfo?

Alexander Belopolsky alexander.belopolsky at gmail.com
Mon Sep 14 22:01:03 CEST 2015


On Mon, Sep 14, 2015 at 3:49 PM, Tim Peters <tim.peters at gmail.com> wrote:

> It depends on how expensive .utcoffset()
> is, which in turn depends on how the tzinfo author implements it.
>

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,
"'premature optimization'
applies at this time."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150914/58681ec5/attachment.html>


More information about the Python-list mailing list