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

Skip to content

Commit d61d0d3

Browse files
committed
Added API information for the PyCallIter_*() and PySeqIter_*() functions.
Added signatures for some new PyType_*() functions.
1 parent 13b49d3 commit d61d0d3

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

Doc/api/api.tex

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2337,6 +2337,18 @@ \subsection{Type Objects \label{typeObjects}}
23372337
\var{feature}. Type features are denoted by single bit flags.
23382338
\end{cfuncdesc}
23392339

2340+
\begin{cfuncdesc}{int}{PyType_IsSubtype}{PyTypeObject *a, PyTypeObject *b}
2341+
Returns true if \var{a} is a subtype of \var{b}.
2342+
\end{cfuncdesc}
2343+
2344+
\begin{cfuncdesc}{PyObject*}{PyType_GenericAlloc}{PyTypeObject *type,
2345+
int nitems}
2346+
\end{cfuncdesc}
2347+
2348+
\begin{cfuncdesc}{PyObject*}{PyType_GenericNew}{PyTypeObject *type,
2349+
PyObject *args, PyObject *kwds}
2350+
\end{cfuncdesc}
2351+
23402352

23412353
\subsection{The None Object \label{noneObject}}
23422354

@@ -4356,11 +4368,57 @@ \subsection{Module Objects \label{moduleObjects}}
43564368
\end{cfuncdesc}
43574369

43584370

4371+
\subsection{Iterator Objects \label{iterator-objects}}
4372+
4373+
Python provides two general-purpose iterator objects. The first, a
4374+
sequence iterator, works with an arbitrary sequence supporting the
4375+
\method{__getitem__()} method. The second works with a callable
4376+
object and a sentinel value, calling the callable for each item in the
4377+
sequence, and ending the iteration when the sentinel value is
4378+
returned.
4379+
4380+
\begin{cvardesc}{PyTypeObject}{PySeqIter_Type}
4381+
Type object for iterator objects returned by
4382+
\cfunction{PySeqIter_New()} and the one-argument form of the
4383+
\function{iter()} built-in function for built-in sequence types.
4384+
\end{cvardesc}
4385+
4386+
\begin{cfuncdesc}{int}{PySeqIter_Check}{op}
4387+
Return true if the type of \var{op} is \cdata{PySeqIter_Type}.
4388+
\end{cfuncdesc}
4389+
4390+
\begin{cfuncdesc}{PyObject*}{PySeqIter_New}{PyObject *seq}
4391+
Return an iterator that works with a general sequence object,
4392+
\var{seq}. The iteration ends when the sequence raises
4393+
\exception{IndexError} for the subscripting operation.
4394+
\end{cfuncdesc}
4395+
4396+
4397+
\begin{cvardesc}{PyTypeObject}{PyCallIter_Type}
4398+
Type object for iterator objects returned by
4399+
\cfunction{PyCallIter_New()} and the two-argument form of the
4400+
\function{iter()} built-in function.
4401+
\end{cvardesc}
4402+
4403+
\begin{cfuncdesc}{int}{PyCallIter_Check}{op}
4404+
Return true if the type of \var{op} is \cdata{PyCallIter_Type}.
4405+
\end{cfuncdesc}
4406+
4407+
\begin{cfuncdesc}{PyObject*}{PyCallIter_New}{PyObject *callable,
4408+
PyObject *sentinel}
4409+
Return a new iterator. The first parameter, \var{callable}, can be
4410+
any Python callable object that can be called with no parameters;
4411+
each call to it should return the next item in the iteration. When
4412+
\var{callable} returns a value equal to \var{sentinel}, the
4413+
iteration will be terminated.
4414+
\end{cfuncdesc}
4415+
4416+
43594417
\subsection{CObjects \label{cObjects}}
43604418

43614419
\obindex{CObject}
43624420
Refer to \emph{Extending and Embedding the Python Interpreter},
4363-
section 1.12 (``Providing a C API for an Extension Module''), for more
4421+
section 1.12 (``Providing a C API for an Extension Module), for more
43644422
information on using these objects.
43654423
43664424

Doc/api/refcounts.dat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ PyCObject_FromVoidPtrAndDesc:void(*)(void*,void*):destr::
6767
PyCObject_GetDesc:void*:::
6868
PyCObject_GetDesc:PyObject*:self:0:
6969

70+
PyCallIter_New:PyObject*::+1:
71+
PyCallIter_New:PyObject*:callable::
72+
PyCallIter_New:PyObject*:sentinel::
73+
7074
PyCallable_Check:int:::
7175
PyCallable_Check:PyObject*:o:0:
7276

@@ -845,6 +849,9 @@ PyRun_String:int:start::
845849
PyRun_String:PyObject*:globals:0:
846850
PyRun_String:PyObject*:locals:0:
847851

852+
PySeqIter_New:PyObject*::+1:
853+
PySeqIter_New:PyObject*:seq::
854+
848855
PySequence_Check:int:::
849856
PySequence_Check:PyObject*:o:0:
850857

0 commit comments

Comments
 (0)