summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-06-01 15:22:42 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-06-01 15:22:42 (GMT)
commite440e47e91a93ae57870da8753f9c141c4a37885 (patch)
treeb51a0c792d63b9357dccbd781000d2c4ea8274b0 /Doc/api
parent09e2cb0ba70aeb52bf6562120103573d7f65cbd6 (diff)
downloadcpython-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.tex31
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}