• Tim Peters's avatar
    SF bug 693121: Set == non-Set is a TypeError. · 44f14b03
    Tim Peters yazdı
    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__.
    44f14b03
sets.py 17.9 KB