]> granicus.if.org Git - python/commitdiff
Added documentation for PySequence_Fast() and PySequence_Fast_GET_ITEM().
authorFred Drake <fdrake@acm.org>
Tue, 12 Sep 2000 15:22:05 +0000 (15:22 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 12 Sep 2000 15:22:05 +0000 (15:22 +0000)
Doc/api/api.tex
Doc/api/refcounts.dat

index 836d677e4d96ecaa7044b5d1bc7ddf4210f800f3..fe56705f949489b0966e003a02adc477dfc5cd1e 100644 (file)
@@ -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}
index bb71d717e461bb2d9067e297a9179bcc94f686a3..09a727e50d49c2f251bc58240db8d07ae3d9d0b1 100644 (file)
@@ -702,6 +702,14 @@ PySequence_DelSlice:PyObject*:o:0:
 PySequence_DelSlice:int:i1::
 PySequence_DelSlice:int:i2::
 
+PySequence_Fast:PyObject*::+1:
+PySequence_Fast:PyObject*:v:0:
+PySequence_Fast:const char*:m::
+
+PySequence_Fast_GET_ITEM:PyObject*::0:
+PySequence_Fast_GET_ITEM:PyObject*:o:0:
+PySequence_Fast_GET_ITEM:int:i::
+
 PySequence_GetItem:PyObject*::+1:
 PySequence_GetItem:PyObject*:o:0:
 PySequence_GetItem:int:i::