diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-06-01 15:22:42 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-06-01 15:22:42 (GMT) |
commit | e440e47e91a93ae57870da8753f9c141c4a37885 (patch) | |
tree | b51a0c792d63b9357dccbd781000d2c4ea8274b0 /Doc/api | |
parent | 09e2cb0ba70aeb52bf6562120103573d7f65cbd6 (diff) | |
download | cpython-e440e47e91a93ae57870da8753f9c141c4a37885.zip cpython-e440e47e91a93ae57870da8753f9c141c4a37885.tar.gz cpython-e440e47e91a93ae57870da8753f9c141c4a37885.tar.bz2 |
Patch #957398: Add public API for Generator Object/Type.
Diffstat (limited to 'Doc/api')
-rw-r--r-- | Doc/api/concrete.tex | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Doc/api/concrete.tex b/Doc/api/concrete.tex index e602528..62084bd 100644 --- a/Doc/api/concrete.tex +++ b/Doc/api/concrete.tex @@ -2603,3 +2603,34 @@ when accessed. Cell objects are not likely to be useful elsewhere. reference counts are adjusted, and no checks are made for safety; \var{cell} must be non-\NULL{} and must be a cell object. \end{cfuncdesc} + + +\subsection{Generator Objects \label{gen-objects}} + +Generator objects are what Python uses to implement generator iterators. +They are normally created by iterating over a function that yields values, +rather than explicitly calling \cfunction{PyGen_New}. + +\begin{ctypedesc}{PyGenObject} + The C structure used for generator objects. +\end{ctypedesc} + +\begin{cvardesc}{PyTypeObject}{PyGen_Type} + The type object corresponding to generator objects +\end{cvardesc} + +\begin{cfuncdesc}{int}{PyGen_Check}{ob} + Return true if \var{ob} is a generator object; \var{ob} must not be + \NULL. +\end{cfuncdesc} + +\begin{cfuncdesc}{int}{PyGen_CheckExact}{ob} + Return true if \var{ob}'s type is \var{PyGen_Type} + is a generator object; \var{ob} must not be + \NULL. +\end{cfuncdesc} + +\begin{cfuncdesc}{PyObject*}{PyGen_New}{PyFrameObject *frame} + Create and return a new generator object based on the \var{frame} object. + The parameter must not be \NULL. +\end{cfuncdesc} |