Author: Lukas Diekmann <[email protected]>
Branch: list-strategies
Changeset: r47473:f367e25b4ed2
Date: 2011-03-16 13:06 +0100
http://bitbucket.org/pypy/pypy/changeset/f367e25b4ed2/
Log: Replaced some more wrappeditems
diff --git a/pypy/module/cpyext/listobject.py b/pypy/module/cpyext/listobject.py
--- a/pypy/module/cpyext/listobject.py
+++ b/pypy/module/cpyext/listobject.py
@@ -32,7 +32,7 @@
Py_DecRef(space, w_item)
if not isinstance(w_list, W_ListObject):
PyErr_BadInternalCall(space)
- wrappeditems = w_list.wrappeditems
+ wrappeditems = w_list.getitems()
if index < 0 or index >= len(wrappeditems):
raise OperationError(space.w_IndexError, space.wrap(
"list assignment index out of range"))
@@ -47,7 +47,7 @@
IndexError exception."""
if not isinstance(w_list, W_ListObject):
PyErr_BadInternalCall(space)
- wrappeditems = w_list.wrappeditems
+ wrappeditems = w_list.getitems()
if index < 0 or index >= len(wrappeditems):
raise OperationError(space.w_IndexError, space.wrap(
"list index out of range"))
@@ -74,7 +74,7 @@
"""Macro form of PyList_Size() without error checking.
"""
assert isinstance(w_list, W_ListObject)
- return len(w_list.wrappeditems)
+ return len(w_list.getitems())
@cpython_api([PyObject], Py_ssize_t, error=-1)
diff --git a/pypy/module/cpyext/sequence.py b/pypy/module/cpyext/sequence.py
--- a/pypy/module/cpyext/sequence.py
+++ b/pypy/module/cpyext/sequence.py
@@ -57,7 +57,7 @@
PySequence_Fast(), o is not NULL, and that i is within bounds.
"""
if isinstance(w_obj, listobject.W_ListObject):
- w_res = w_obj.wrappeditems[index]
+ w_res = w_obj.getitem(index)
else:
assert isinstance(w_obj, tupleobject.W_TupleObject)
w_res = w_obj.wrappeditems[index]
@@ -71,7 +71,7 @@
PySequence_Fast_GET_SIZE() is faster because it can assume o is a list
or tuple."""
if isinstance(w_obj, listobject.W_ListObject):
- return len(w_obj.wrappeditems)
+ return w_obj.length()
assert isinstance(w_obj, tupleobject.W_TupleObject)
return len(w_obj.wrappeditems)
diff --git a/pypy/objspace/std/marshal_impl.py
b/pypy/objspace/std/marshal_impl.py
--- a/pypy/objspace/std/marshal_impl.py
+++ b/pypy/objspace/std/marshal_impl.py
@@ -300,7 +300,7 @@
register(TYPE_TUPLE, unmarshal_Tuple)
def marshal_w__List(space, w_list, m):
- items = w_list.wrappeditems[:]
+ items = w_list.getitems()
m.put_tuple_w(TYPE_LIST, items)
def unmarshal_List(space, u, tc):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit