mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Use a new macro, PySequence_Fast_ITEMS to factor out code common to
three recent optimizations. Aside from reducing code volume, it increases readability.
This commit is contained in:
parent
989ddc0709
commit
c1e4f9dd92
4 changed files with 19 additions and 16 deletions
|
@ -830,6 +830,13 @@ determination.
|
|||
and that \var{i} is within bounds.
|
||||
\end{cfuncdesc}
|
||||
|
||||
\begin{cfuncdesc}{PyObject**}{PySequence_Fast_ITEMS}{PyObject *o}
|
||||
Return the underlying array of PyObject pointers. Assumes that
|
||||
\var{o} was returned by \cfunction{PySequence_Fast()} and
|
||||
\var{o} is not \NULL.
|
||||
\versionadded{2.4}
|
||||
\end{cfuncdesc}
|
||||
|
||||
\begin{cfuncdesc}{PyObject*}{PySequence_ITEM}{PyObject *o, int i}
|
||||
Return the \var{i}th element of \var{o} or \NULL{} on failure.
|
||||
Macro form of \cfunction{PySequence_GetItem()} but without checking
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue