Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 81cccb7

Browse files
committed
Added documentation for PySequence_Fast() and PySequence_Fast_GET_ITEM().
1 parent aafc0c4 commit 81cccb7

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Doc/api/api.tex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,23 @@ \section{Sequence Protocol \label{sequence}}
17801780
\end{cfuncdesc}
17811781

17821782

1783+
\begin{cfuncdesc}{PyObject*}{PySequence_Fast}{PyObject *o, const char *m}
1784+
Returns the sequence \var{o} as a tuple, unless it is already a
1785+
tuple or list, in which case \var{o} is returned. Use
1786+
\cfunction{PySequence_Fast_GET_ITEM()} to access the members of the
1787+
result. Returns \NULL{} on failure. If the object is not a sequence,
1788+
raises \exception{TypeError} with \var{m} as the message text.
1789+
\end{cfuncdesc}
1790+
1791+
\begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, int i}
1792+
Return the \var{i}th element of \var{o}, assuming that \var{o} was
1793+
returned by \cfunction{PySequence_Fast()}, and that \var{i} is within
1794+
bounds. The caller is expected to get the length of the sequence by
1795+
calling \cfunction{PyObject_Size()} on \var{o}, since lists and tuples
1796+
are guaranteed to always return their true length.
1797+
\end{cfuncdesc}
1798+
1799+
17831800
\section{Mapping Protocol \label{mapping}}
17841801

17851802
\begin{cfuncdesc}{int}{PyMapping_Check}{PyObject *o}

Doc/api/refcounts.dat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,14 @@ PySequence_DelSlice:PyObject*:o:0:
702702
PySequence_DelSlice:int:i1::
703703
PySequence_DelSlice:int:i2::
704704

705+
PySequence_Fast:PyObject*::+1:
706+
PySequence_Fast:PyObject*:v:0:
707+
PySequence_Fast:const char*:m::
708+
709+
PySequence_Fast_GET_ITEM:PyObject*::0:
710+
PySequence_Fast_GET_ITEM:PyObject*:o:0:
711+
PySequence_Fast_GET_ITEM:int:i::
712+
705713
PySequence_GetItem:PyObject*::+1:
706714
PySequence_GetItem:PyObject*:o:0:
707715
PySequence_GetItem:int:i::

0 commit comments

Comments
 (0)