diff options
author | Guido van Rossum <guido@python.org> | 1998-04-24 18:22:02 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-04-24 18:22:02 (GMT) |
commit | a937d14898e8e396a1c9acc0fbd2db5209d1a6ce (patch) | |
tree | 797b23e8e3562d0c5a712b863678af4065645685 | |
parent | 7b7a2c2e110a2a9d5bb7c4f0c0dbda74e215059f (diff) | |
download | cpython-a937d14898e8e396a1c9acc0fbd2db5209d1a6ce.zip cpython-a937d14898e8e396a1c9acc0fbd2db5209d1a6ce.tar.gz cpython-a937d14898e8e396a1c9acc0fbd2db5209d1a6ce.tar.bz2 |
Fred's right -- we need PyList_SET_ITEM().
-rw-r--r-- | Doc/api.tex | 5 | ||||
-rw-r--r-- | Doc/api/api.tex | 5 | ||||
-rw-r--r-- | Include/listobject.h | 1 | ||||
-rw-r--r-- | Python/bltinmodule.c | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/Doc/api.tex b/Doc/api.tex index 5f168f2..b0b7bfd 100644 --- a/Doc/api.tex +++ b/Doc/api.tex @@ -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} diff --git a/Doc/api/api.tex b/Doc/api/api.tex index 5f168f2..b0b7bfd 100644 --- a/Doc/api/api.tex +++ b/Doc/api/api.tex @@ -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} diff --git a/Include/listobject.h b/Include/listobject.h index c1bbcc1..e99acef 100644 --- a/Include/listobject.h +++ b/Include/listobject.h @@ -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 diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 8a4215b..fd31405 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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; |