Kaydet (Commit) a937d148 authored tarafından Guido van Rossum's avatar Guido van Rossum

Fred's right -- we need PyList_SET_ITEM().

üst 7b7a2c2e
......@@ -1953,6 +1953,11 @@ Returns a new tuple object containing the contents of \var{list}.
Macro form of \cfunction{PyList_GetItem()} without error checking.
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyList_SET_ITEM}{PyObject *list, int i,
PyObject *o}
Macro form of \cfunction{PyList_SetItem()} without error checking.
\end{cfuncdesc}
\begin{cfuncdesc}{int}{PyList_GET_SIZE}{PyObject *list}
Macro form of \cfunction{PyList_GetSize()} without error checking.
\end{cfuncdesc}
......
......@@ -1953,6 +1953,11 @@ Returns a new tuple object containing the contents of \var{list}.
Macro form of \cfunction{PyList_GetItem()} without error checking.
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyList_SET_ITEM}{PyObject *list, int i,
PyObject *o}
Macro form of \cfunction{PyList_SetItem()} without error checking.
\end{cfuncdesc}
\begin{cfuncdesc}{int}{PyList_GET_SIZE}{PyObject *list}
Macro form of \cfunction{PyList_GetSize()} without error checking.
\end{cfuncdesc}
......
......@@ -74,6 +74,7 @@ extern PyObject *PyList_AsTuple Py_PROTO((PyObject *));
/* Macro, trading safety for speed */
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
#define PyList_GET_SIZE(op) (((PyListObject *)(op))->ob_size)
#ifdef __cplusplus
......
......@@ -1282,7 +1282,7 @@ builtin_range(self, args)
Py_DECREF(v);
return NULL;
}
PyList_GET_ITEM(v, i) = w;
PyList_SET_ITEM(v, i, w);
ilow += istep;
}
return v;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment