Author: Laurence Tratt <[email protected]>
Branch: more_strategies
Changeset: r67881:1f36c73c569a
Date: 2013-11-08 10:29 +0000
http://bitbucket.org/pypy/pypy/changeset/1f36c73c569a/
Log: Remove unnecessary double type-check.
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -1538,7 +1538,6 @@
def getitems_int(self, w_list):
return self.unerase(w_list.lstorage)
- _orig_find = find
def find(self, w_list, w_obj, start, stop):
# Find an element in this integer list. For integers, floats, and
longs,
# we can use primitive comparisons (possibly after a conversion to an
@@ -1584,7 +1583,7 @@
raise ValueError
elif self.space.type(w_obj).compares_by_identity():
raise ValueError
- return self._orig_find(w_list, w_obj, start, stop)
+ return ListStrategy.find(self, w_list, w_obj, start, stop)
_base_extend_from_list = _extend_from_list
@@ -1630,7 +1629,6 @@
def list_is_correct_type(self, w_list):
return w_list.strategy is self.space.fromcache(FloatListStrategy)
- _orig_find = find
def find(self, w_list, w_obj, start, stop):
w_objt = type(w_obj)
if w_objt is W_FloatObject:
@@ -1641,7 +1639,7 @@
raise ValueError
elif self.space.type(w_obj).compares_by_identity():
raise ValueError
- return self._orig_find(w_list, w_obj, start, stop)
+ return ListStrategy.find(self, w_list, w_obj, start, stop)
def sort(self, w_list, reverse):
l = self.unerase(w_list.lstorage)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit