commit | 44f14b039949005ecc93fd8294933c84fab6f374 | [log] [tgz] |
---|---|---|
author | Tim Peters <tim.peters@gmail.com> | Sun Mar 02 00:19:49 2003 +0000 |
committer | Tim Peters <tim.peters@gmail.com> | Sun Mar 02 00:19:49 2003 +0000 |
tree | e68c8735baa42a015f34cd37c2d3c89020f8ee97 | |
parent | 3ba491e6b1747707374e56fd9f0fb958b2aafcd5 [diff] |
SF bug 693121: Set == non-Set is a TypeError. Allow mixed-type __eq__ and __ne__ for Set objects. This is messier than I'd like because Set *also* implements __cmp__. I know of one glitch now: cmp(s, t) returns 0 now when s and t are both Sets and s == t, despite that Set.__cmp__ unconditionally raises TypeError (and by intent). The rub is that __eq__ gets tried first, and the x.__eq__(y) True result convinces Python that cmp(x, y) is 0 without even calling Set.__cmp__.