Author: Lukas Diekmann <[email protected]>
Branch: set-strategies
Changeset: r49237:624230481d9a
Date: 2011-10-14 11:01 +0200
http://bitbucket.org/pypy/pypy/changeset/624230481d9a/
Log: _never_equal_to_string makes no sense here
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
@@ -435,10 +435,7 @@
from pypy.objspace.std.dictmultiobject import _never_equal_to_string
d = self.unerase(w_set.sstorage)
if not self.is_correct_type(w_item):
- # XXX I don't understand the next line. shouldn't it be "never
- # equal to int" in the int strategy case?
- if _never_equal_to_string(self.space, self.space.type(w_item)):
- return False
+ #XXX check type of w_item and immediately return False in some
cases
w_set.switch_to_object_strategy(self.space)
return w_set.remove(w_item)
@@ -469,12 +466,9 @@
def has_key(self, w_set, w_key):
from pypy.objspace.std.dictmultiobject import _never_equal_to_string
if not self.is_correct_type(w_key):
- # XXX I don't understand the next line. shouldn't it be "never
- # equal to int" in the int strategy case?
- if not _never_equal_to_string(self.space, self.space.type(w_key)):
- w_set.switch_to_object_strategy(self.space)
- return w_set.has_key(w_key)
- return False
+ #XXX check type of w_item and immediately return False in some
cases
+ w_set.switch_to_object_strategy(self.space)
+ return w_set.has_key(w_key)
d = self.unerase(w_set.sstorage)
return self.unwrap(w_key) in d
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit