On Tue, Sep 8, 2015 at 1:06 PM, Tim Peters <[email protected]> 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. :-)
_______________________________________________ Datetime-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/datetime-sig The PSF Code of Conduct applies to this mailing list: https://www.python.org/psf/codeofconduct/
