Restore the previous definition of __eq__ for d_values.

There was a reason I did it by modifying a list!
This commit is contained in:
Guido van Rossum 2007-02-24 05:41:38 +00:00
parent 0e97bb856c
commit 33498634af
1 changed files with 5 additions and 1 deletions

View File

@ -247,9 +247,13 @@ I'm using pseudo-code to specify the semantics::
# XXX Sometimes this could be optimized, but these are the
# semantics: we can't depend on the values to be hashable
# or comparable.
olist = list(other)
for x in self:
if not o in other:
try:
olist.remove(x)
except ValueError:
return False
assert olist == []
return True
def __ne__(self, other):