summaryrefslogtreecommitdiff
path: root/Doc/c-api/gen.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2015-09-06 21:44:45 +0300
committerEzio Melotti <ezio.melotti@gmail.com>2015-09-06 21:44:45 +0300
commitf352202977fc53197bd38198b1ac26ed4008a9ba (patch)
tree34246df426e6f7d82794886be98c613903a5655e /Doc/c-api/gen.rst
parentd68070857ae58758849446f5ae162ff3bffb7d6e (diff)
parent2936930f6c8fc1d8992b680181c30f417d74b7c2 (diff)
downloadcpython-f352202977fc53197bd38198b1ac26ed4008a9ba.tar.gz
#23144: merge with 3.4.
Diffstat (limited to 'Doc/c-api/gen.rst')
-rw-r--r--Doc/c-api/gen.rst20
1 files changed, 13 insertions, 7 deletions
diff --git a/Doc/c-api/gen.rst b/Doc/c-api/gen.rst
index 33cd27a5aa..3ab073b191 100644
--- a/Doc/c-api/gen.rst
+++ b/Doc/c-api/gen.rst
@@ -7,7 +7,7 @@ Generator 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 :c:func:`PyGen_New`.
+than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
.. c:type:: PyGenObject
@@ -20,19 +20,25 @@ than explicitly calling :c:func:`PyGen_New`.
The type object corresponding to generator objects
-.. c:function:: int PyGen_Check(ob)
+.. c:function:: int PyGen_Check(PyObject *ob)
Return true if *ob* is a generator object; *ob* must not be *NULL*.
-.. c:function:: int PyGen_CheckExact(ob)
+.. c:function:: int PyGen_CheckExact(PyObject *ob)
- Return true if *ob*'s type is *PyGen_Type* is a generator object; *ob* must not
- be *NULL*.
+ Return true if *ob*'s type is *PyGen_Type*; *ob* must not be *NULL*.
.. c:function:: PyObject* PyGen_New(PyFrameObject *frame)
- Create and return a new generator object based on the *frame* object. A
- reference to *frame* is stolen by this function. The parameter must not be
+ Create and return a new generator object based on the *frame* object.
+ A reference to *frame* is stolen by this function. The argument must not be
*NULL*.
+
+.. c:function:: PyObject* PyGen_NewWithQualName(PyFrameObject *frame, PyObject *name, PyObject *qualname)
+
+ Create and return a new generator object based on the *frame* object,
+ with ``__name__`` and ``__qualname__`` set to *name* and *qualname*.
+ A reference to *frame* is stolen by this function. The *frame* argument
+ must not be *NULL*.