On Tue, Sep 8, 2015 at 1:06 PM, Tim Peters <[email protected]> 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
_______________________________________________
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/

Reply via email to