Objeto Generator¶
Objetos geradores são o que o Python usa para implementar iteradores geradores. Eles são normalmente criados por iteração sobre uma função que produz valores, em vez de invocar explicitamente PyGen_New() ou PyGen_NewWithQualName().
-
PyGenObject¶ A estrutura C usada para objetos geradores.
-
PyTypeObject
PyGen_Type¶ O objeto de tipo correspondendo a objetos geradores.
-
PyObject*
PyGen_New(PyFrameObject *frame)¶ - Return value: New reference.
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.
-
PyObject*
PyGen_NewWithQualName(PyFrameObject *frame, PyObject *name, PyObject *qualname)¶ - Return value: New reference.
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.
