Author: Matti Picus <[email protected]>
Branch:
Changeset: r92712:382f89d5d1c5
Date: 2017-10-11 10:52 +1100
http://bitbucket.org/pypy/pypy/changeset/382f89d5d1c5/
Log: fix annotation for 1b7397a88e79 - same signature for {set,
list}.switch_to_object_strategy()
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
@@ -47,9 +47,9 @@
def delweakref(self):
self._lifeline_ = None
- def switch_to_object_strategy(self, space):
+ def switch_to_object_strategy(self):
d = self.strategy.getdict_w(self)
- self.strategy = strategy = space.fromcache(ObjectSetStrategy)
+ self.strategy = strategy = self.space.fromcache(ObjectSetStrategy)
self.sstorage = strategy.erase(d)
def switch_to_empty_strategy(self):
@@ -912,14 +912,14 @@
d = self.unerase(w_set.sstorage)
d[self.unwrap(w_key)] = None
else:
- w_set.switch_to_object_strategy(self.space)
+ w_set.switch_to_object_strategy()
w_set.add(w_key)
def remove(self, w_set, w_item):
d = self.unerase(w_set.sstorage)
if not self.is_correct_type(w_item):
#XXX check type of w_item and immediately return False in some
cases
- w_set.switch_to_object_strategy(self.space)
+ w_set.switch_to_object_strategy()
return w_set.remove(w_item)
key = self.unwrap(w_item)
@@ -949,7 +949,7 @@
def has_key(self, w_set, w_key):
if not self.is_correct_type(w_key):
#XXX check type of w_item and immediately return False in some
cases
- w_set.switch_to_object_strategy(self.space)
+ w_set.switch_to_object_strategy()
return w_set.has_key(w_key)
d = self.unerase(w_set.sstorage)
return self.unwrap(w_key) in d
@@ -1205,7 +1205,7 @@
return
if w_other.length() == 0:
return
- w_set.switch_to_object_strategy(self.space)
+ w_set.switch_to_object_strategy()
w_set.update(w_other)
def popitem(self, w_set):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit