R. David Murray added the comment: I did look at the code. Indeed list and tuple compare x to e, while dict, set, and frozenset (well, I didn't check each one, just list and set) compare the e to x, where e is they key stored at hash(x).
Steve has a good point about the iteration. And a user class can do anything it wants in contains. I wonder if it would be even more accurate to say "conceptually equal" rather than "approximately equal", given that hash table 'in' doesn't do iteration at all. ---------- nosy: +r.david.murray _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27605> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com