[Datetime-SIG] PEP 495: What's left to resolve
Alexander Belopolsky
alexander.belopolsky at gmail.com
Tue Sep 8 19:50:15 CEST 2015
On Tue, Sep 8, 2015 at 1:06 PM, Tim Peters <tim.peters at gmail.com> wrote:
> > I note that we can add obvious optimizations for the common tzinfo is
> > datetime.timezone.utc and isinstance(tzinfo, datetime.timezone) cases.
>
> Please no. Comparison is almost certainly almost always intrazone,
> and .utcoffset() isn't called at all for intrazone comparisons.
I don't understand this comment. Solution 3 does not change anything for
the intrazone (self.tzinfo is other.tzinfo) comparisons. Are you just
saying that a slowdown in interzone comparison is a welcome feature to
discourage bad programming practices? Sorry, I have a few ideas on how to
optimize Solution 3 __eq__ even without special-casing fixed-offset
tzinfos. :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150908/cfe229b8/attachment-0001.html>
More information about the Datetime-SIG
mailing list