diff options
author | Fred Drake <fdrake@acm.org> | 2000-09-12 15:22:05 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-09-12 15:22:05 (GMT) |
commit | 81cccb7563bdffacc475e50510951a0c3eaf31ef (patch) | |
tree | 4d580f1269e92f5bf1c0ec46b0ca4bb87103f7fc /Doc/api/api.tex | |
parent | aafc0c4595c0e762ea598789537314ab95cbf524 (diff) | |
download | cpython-81cccb7563bdffacc475e50510951a0c3eaf31ef.zip cpython-81cccb7563bdffacc475e50510951a0c3eaf31ef.tar.gz cpython-81cccb7563bdffacc475e50510951a0c3eaf31ef.tar.bz2 |
Added documentation for PySequence_Fast() and PySequence_Fast_GET_ITEM().
Diffstat (limited to 'Doc/api/api.tex')
-rw-r--r-- | Doc/api/api.tex | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/api/api.tex b/Doc/api/api.tex index 836d677..fe56705 100644 --- a/Doc/api/api.tex +++ b/Doc/api/api.tex @@ -1780,6 +1780,23 @@ otherwise a tuple will be constructed with the appropriate contents. \end{cfuncdesc} +\begin{cfuncdesc}{PyObject*}{PySequence_Fast}{PyObject *o, const char *m} +Returns the sequence \var{o} as a tuple, unless it is already a +tuple or list, in which case \var{o} is returned. Use +\cfunction{PySequence_Fast_GET_ITEM()} to access the members of the +result. Returns \NULL{} on failure. If the object is not a sequence, +raises \exception{TypeError} with \var{m} as the message text. +\end{cfuncdesc} + +\begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, int i} +Return the \var{i}th element of \var{o}, assuming that \var{o} was +returned by \cfunction{PySequence_Fast()}, and that \var{i} is within +bounds. The caller is expected to get the length of the sequence by +calling \cfunction{PyObject_Size()} on \var{o}, since lists and tuples +are guaranteed to always return their true length. +\end{cfuncdesc} + + \section{Mapping Protocol \label{mapping}} \begin{cfuncdesc}{int}{PyMapping_Check}{PyObject *o} |