[pypy-commit] pypy set-strategies: to be consistent create a set and call difference_update here too

l.diekmann noreply at buildbot.pypy.org
Thu Nov 10 13:51:32 CET 2011


Author: Lukas Diekmann <lukas.diekmann at uni-duesseldorf.de>
Branch: set-strategies
Changeset: r49217:5676c0591355
Date: 2011-10-11 14:30 +0200
http://bitbucket.org/pypy/pypy/changeset/5676c0591355/

Log:	to be consistent create a set and call difference_update here too

diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -910,9 +910,8 @@
             # optimization only
             w_left.difference_update(w_other)
         else:
-            for w_key in space.listview(w_other):
-                space.hash(w_key)
-                w_left.remove(w_key)
+            w_other_as_set = w_left._newobj(space, w_other)
+            w_left.difference_update(w_other_as_set)
 
 def inplace_sub__Set_Set(space, w_left, w_other):
     w_left.difference_update(w_other)


More information about the pypy-commit mailing list