[pypy-commit] pypy set-strategies: this is already checked in _difference_base

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


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

Log:	this is already checked in _difference_base

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
@@ -400,10 +400,6 @@
         return strategy.erase(d_new)
 
     def _difference_unwrapped(self, w_set, w_other):
-        # XXX this line should not be needed
-        # the caller (_difference_base) already checks for this!
-        if not isinstance(w_other, W_BaseSetObject):
-            w_other = w_set._newobj(self.space, w_other)
         iterator = self.unerase(w_set.sstorage).iterkeys()
         other_dict = self.unerase(w_other.sstorage)
         result_dict = self.get_empty_dict()
@@ -416,7 +412,6 @@
         if not isinstance(w_other, W_BaseSetObject):
             w_other = w_set._newobj(self.space, w_other)
 
-        # XXX shouldn't w_set.strategy be simply "self"?
         if self is w_other.strategy:
             strategy = w_set.strategy
             storage = self._difference_unwrapped(w_set, w_other)


More information about the pypy-commit mailing list