<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 8, 2015 at 1:06 PM, Tim Peters <span dir="ltr"><<a href="mailto:tim.peters@gmail.com" target="_blank">tim.peters@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> def __eq__(self, other):<br>
>     n_self = self.replace(tzinfo=None)<br>
>     n_other = other.replace(tzinfo=None)<br>
>     if self.tzinfo is other.tzinfo:<br>
>         return n_self == n_other<br>
<br>
</span>Well, that's infinite recursion - but I know what you mean ;-)<br></blockquote><div><br></div><div>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.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
<br>
>     u_self = n_self - self.utcoffset()<br>
>     v_self = n_self - self.replace(fold=(1-self.fold)).utcoffset()<br>
>     u_other = n_other - other.utcoffset()<br>
>     v_other = n_other - other.replace(fold=(1-self.fold)).utcoffset()<br>
>     return u_self == u_other == v_self == v_other<br>
<br>
</span>More infinite recursion.</blockquote></div><br>ditto</div></div>