<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 22, 2015 at 8:16 AM, 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">[Tim]<br>
> ...<br>
<span class="">> The<br>
> top-level operation on the RHS is datetime.fromtimestamp().  However,<br>
> it didn't pass a tzinfo, so it creates a naive datetime.  Assuming dt<br>
> was aware to begin with, the attempt to compare will always (gap or<br>
> not) raise an exception.<br>
<br>
</span>Oops!  In current Python, comparing naive and aware via `==` just<br>
returns False.  That's even more confusing ;-)<br>
</blockquote></div><br></div><div class="gmail_extra">Hm, but that's in general how == is *supposed* to work between objects of incompatible types. < and > are supposed to fail but == is supposed to return False (the __eq__ should return NotImplemented). If == ever raises an exception, having two different objects as dict keys can cause random, hard-to-debug failures.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>