[pypy-commit] pypy dynamic-specialized-tuple: (fijal, alex): translation fix?
alex_gaynor
noreply at buildbot.pypy.org
Tue Mar 13 09:23:39 CET 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: dynamic-specialized-tuple
Changeset: r53441:5f1b6449a290
Date: 2012-03-13 01:23 -0700
http://bitbucket.org/pypy/pypy/changeset/5f1b6449a290/
Log: (fijal, alex): translation fix?
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
@@ -1046,7 +1046,7 @@
if isinstance(w_iterable, W_ListObject):
w_list.extend(w_iterable)
elif isinstance(w_iterable, W_TupleObject):
- w_list.extend(W_ListObject(space, w_iterable.tolist(space)))
+ w_list.extend(W_ListObject(space, w_iterable.tolist_resized(space)))
else:
_init_from_iterable(space, w_list, w_iterable)
diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -35,7 +35,10 @@
items_w = [None] * self.length()
for i in xrange(self.length()):
items_w[i] = self.getitem(space, i)
- return items_w[:]
+ return items_w
+
+ def tolist_resized(self, space):
+ return self.tolist(space)[:]
def getitems_copy(self, space):
return self.tolist(space)
More information about the pypy-commit
mailing list