[Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.148,1.149 refcounts.dat,1.31,1.32
Fred L. Drake
fdrake@users.sourceforge.net
Sat, 22 Sep 2001 19:05:28 -0700
Update of /cvsroot/python/python/dist/src/Doc/api
In directory usw-pr-cvs1:/tmp/cvs-serv4691
Modified Files:
api.tex refcounts.dat
Log Message:
Added API information for the PyCallIter_*() and PySeqIter_*() functions.
Added signatures for some new PyType_*() functions.
Index: api.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v
retrieving revision 1.148
retrieving revision 1.149
diff -C2 -d -r1.148 -r1.149
*** api.tex 2001/09/20 19:18:52 1.148
--- api.tex 2001/09/23 02:05:26 1.149
***************
*** 2338,2342 ****
--- 2338,2354 ----
\end{cfuncdesc}
+ \begin{cfuncdesc}{int}{PyType_IsSubtype}{PyTypeObject *a, PyTypeObject *b}
+ Returns true if \var{a} is a subtype of \var{b}.
+ \end{cfuncdesc}
+
+ \begin{cfuncdesc}{PyObject*}{PyType_GenericAlloc}{PyTypeObject *type,
+ int nitems}
+ \end{cfuncdesc}
+ \begin{cfuncdesc}{PyObject*}{PyType_GenericNew}{PyTypeObject *type,
+ PyObject *args, PyObject *kwds}
+ \end{cfuncdesc}
+
+
\subsection{The None Object \label{noneObject}}
***************
*** 4357,4365 ****
\subsection{CObjects \label{cObjects}}
\obindex{CObject}
Refer to \emph{Extending and Embedding the Python Interpreter},
! section 1.12 (``Providing a C API for an Extension Module''), for more
information on using these objects.
--- 4369,4423 ----
+ \subsection{Iterator Objects \label{iterator-objects}}
+
+ Python provides two general-purpose iterator objects. The first, a
+ sequence iterator, works with an arbitrary sequence supporting the
+ \method{__getitem__()} method. The second works with a callable
+ object and a sentinel value, calling the callable for each item in the
+ sequence, and ending the iteration when the sentinel value is
+ returned.
+
+ \begin{cvardesc}{PyTypeObject}{PySeqIter_Type}
+ Type object for iterator objects returned by
+ \cfunction{PySeqIter_New()} and the one-argument form of the
+ \function{iter()} built-in function for built-in sequence types.
+ \end{cvardesc}
+
+ \begin{cfuncdesc}{int}{PySeqIter_Check}{op}
+ Return true if the type of \var{op} is \cdata{PySeqIter_Type}.
+ \end{cfuncdesc}
+
+ \begin{cfuncdesc}{PyObject*}{PySeqIter_New}{PyObject *seq}
+ Return an iterator that works with a general sequence object,
+ \var{seq}. The iteration ends when the sequence raises
+ \exception{IndexError} for the subscripting operation.
+ \end{cfuncdesc}
+
+
+ \begin{cvardesc}{PyTypeObject}{PyCallIter_Type}
+ Type object for iterator objects returned by
+ \cfunction{PyCallIter_New()} and the two-argument form of the
+ \function{iter()} built-in function.
+ \end{cvardesc}
+
+ \begin{cfuncdesc}{int}{PyCallIter_Check}{op}
+ Return true if the type of \var{op} is \cdata{PyCallIter_Type}.
+ \end{cfuncdesc}
+
+ \begin{cfuncdesc}{PyObject*}{PyCallIter_New}{PyObject *callable,
+ PyObject *sentinel}
+ Return a new iterator. The first parameter, \var{callable}, can be
+ any Python callable object that can be called with no parameters;
+ each call to it should return the next item in the iteration. When
+ \var{callable} returns a value equal to \var{sentinel}, the
+ iteration will be terminated.
+ \end{cfuncdesc}
+
+
\subsection{CObjects \label{cObjects}}
\obindex{CObject}
Refer to \emph{Extending and Embedding the Python Interpreter},
! section 1.12 (``Providing a C API for an Extension Module), for more
information on using these objects.
Index: refcounts.dat
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** refcounts.dat 2001/09/20 19:18:52 1.31
--- refcounts.dat 2001/09/23 02:05:26 1.32
***************
*** 68,71 ****
--- 68,75 ----
PyCObject_GetDesc:PyObject*:self:0:
+ PyCallIter_New:PyObject*::+1:
+ PyCallIter_New:PyObject*:callable::
+ PyCallIter_New:PyObject*:sentinel::
+
PyCallable_Check:int:::
PyCallable_Check:PyObject*:o:0:
***************
*** 845,848 ****
--- 849,855 ----
PyRun_String:PyObject*:globals:0:
PyRun_String:PyObject*:locals:0:
+
+ PySeqIter_New:PyObject*::+1:
+ PySeqIter_New:PyObject*:seq::
PySequence_Check:int:::