dicts check by identity in addition to equality
This isn't just a performance optimization, but is actually important since people put things in dicts that don't __eq__ themselves. The common example (and test here) is NaN, but in particular sqlalchemy does this with clauses (where __eq__ returns a new sql clause). Also, handle cases that __eq__ returns non-bool
Showing
Please register or sign in to comment