[Datetime-SIG] PEP 495: What's left to resolve
Alexander Belopolsky
alexander.belopolsky at gmail.com
Tue Sep 8 19:43:51 CEST 2015
On Tue, Sep 8, 2015 at 1:06 PM, Tim Peters <tim.peters at gmail.com> wrote:
> > def __eq__(self, other):
> > n_self = self.replace(tzinfo=None)
> > n_other = other.replace(tzinfo=None)
> > if self.tzinfo is other.tzinfo:
> > return n_self == n_other
>
> Well, that's infinite recursion - but I know what you mean ;-)
>
No. You've probably missed that n_ objects are naive and naive comparison
is just your plain old fold-unaware compare-all-components -except-fold
operation.
>
>
> > u_self = n_self - self.utcoffset()
> > v_self = n_self - self.replace(fold=(1-self.fold)).utcoffset()
> > u_other = n_other - other.utcoffset()
> > v_other = n_other - other.replace(fold=(1-self.fold)).utcoffset()
> > return u_self == u_other == v_self == v_other
>
> More infinite recursion.
ditto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150908/498c9480/attachment.html>
More information about the Datetime-SIG
mailing list