Author: Lukas Diekmann <lukas.diekm...@uni-duesseldorf.de> Branch: list-strategies Changeset: r47524:4ad5f050b10e Date: 2011-08-22 16:58 +0200 http://bitbucket.org/pypy/pypy/changeset/4ad5f050b10e/
Log: no more wrapping/unwrapping in AbstractStrategy.getslice 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 @@ -537,11 +537,15 @@ return W_ListObject.from_storage_and_strategy(self.space, storage, self) else: subitems_w = [None] * length - # XXX wrap/unwrap + l = self.cast_from_void_star(w_list.lstorage) for i in range(length): - subitems_w[i] = w_list.getitem(start) - start += step - return W_ListObject(self.space, subitems_w) + try: + subitems_w[i] = l[start] + start += step + except IndexError: + raise + storage = self.cast_to_void_star(subitems_w) + return W_ListObject.from_storage_and_strategy(self.space, storage, self) def append(self, w_list, w_item): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit