[Python-checkins] r53881 - peps/trunk/pep-3106.txt

guido.van.rossum python-checkins at python.org
Sat Feb 24 06:41:43 CET 2007


Author: guido.van.rossum
Date: Sat Feb 24 06:41:38 2007
New Revision: 53881

Modified:
   peps/trunk/pep-3106.txt
Log:
Restore the previous definition of __eq__ for d_values.
There was a reason I did it by modifying a list!


Modified: peps/trunk/pep-3106.txt
==============================================================================
--- peps/trunk/pep-3106.txt	(original)
+++ peps/trunk/pep-3106.txt	Sat Feb 24 06:41:38 2007
@@ -247,9 +247,13 @@
             # 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):


More information about the Python-checkins mailing list