[pypy-commit] pypy list-strategies: (l.diekmann, cfbolz): more slicing

l.diekmann noreply at buildbot.pypy.org
Fri Sep 23 13:11:08 CEST 2011


Author: Lukas Diekmann <lukas.diekmann at uni-duesseldorf.de>
Branch: list-strategies
Changeset: r47411:e2e33e1676ab
Date: 2011-01-20 14:41 +0100
http://bitbucket.org/pypy/pypy/changeset/e2e33e1676ab/

Log:	(l.diekmann, cfbolz): more slicing

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
@@ -151,9 +151,9 @@
     return w_list.getslice(start, stop, step, slicelength)
 
 def getslice__List_ANY_ANY(space, w_list, w_start, w_stop):
-    length = len(w_list.wrappeditems)
+    length = w_list.length()
     start, stop = normalize_simple_slice(space, length, w_start, w_stop)
-    return W_ListObject(w_list.wrappeditems[start:stop])
+    return w_list.getslice(start, stop, 1, stop - start)
 
 def setslice__List_ANY_ANY_ANY(space, w_list, w_start, w_stop, w_sequence):
     length = len(w_list.wrappeditems)


More information about the pypy-commit mailing list