diff Doc/api/api.tex @ 14519:7435331b48ee legacy-trunk

Added documentation for PySequence_Fast() and PySequence_Fast_GET_ITEM().
author Fred Drake <fdrake@acm.org>
date Tue, 12 Sep 2000 15:22:05 +0000
parents 2de1fb5302ed
children ff4ae691be9b
line wrap: on
line diff
--- a/Doc/api/api.tex	Tue Sep 12 15:20:54 2000 +0000
+++ b/Doc/api/api.tex	Tue Sep 12 15:22:05 2000 +0000
@@ -1780,6 +1780,23 @@
 \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}