Author: Carl Friedrich Bolz <[email protected]>
Branch: list-strategies
Changeset: r47830:623e452781d4
Date: 2011-10-05 11:51 +0200
http://bitbucket.org/pypy/pypy/changeset/623e452781d4/
Log: clean up getitem variants a bit
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
@@ -240,7 +240,7 @@
raise NotImplementedError
def getitems(self, w_list):
- raise NotImplementedError
+ return self.getitems_copy(w_list)
def getitems_copy(self, w_list):
raise NotImplementedError
@@ -325,7 +325,7 @@
return self.cached_emptylist_w
def getitems_copy(self, w_list):
- return self.cached_emptylist_w
+ return []
def getstorage_copy(self, w_list):
return self.erase(None)
@@ -443,9 +443,8 @@
def getitem(self, w_list, i):
return self.wrap(self._getitem_unwrapped(w_list, i))
- def getitems(self, w_list):
+ def getitems_copy(self, w_list):
return self._getitems_range(w_list, True)
- getitems_copy = getitems
def getstorage_copy(self, w_list):
# tuple is unmutable
@@ -626,7 +625,6 @@
jit.isconstant(w_list.length()) and w_list.length() <
UNROLL_CUTOFF)
def getitems_copy(self, w_list):
return [self.wrap(item) for item in self.unerase(w_list.lstorage)]
- getitems = getitems_copy
def getstorage_copy(self, w_list):
items = self.unerase(w_list.lstorage)[:]
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit