~malept/ubuntu/lucid/python2.6/dev-dependency-fix

« back to all changes in this revision

Viewing changes to Doc/c-api/gen.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-13 12:51:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090213125100-uufgcb9yeqzujpqw
Tags: upstream-2.6.1
ImportĀ upstreamĀ versionĀ 2.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. highlightlang:: c
 
2
 
 
3
.. _gen-objects:
 
4
 
 
5
Generator Objects
 
6
-----------------
 
7
 
 
8
Generator objects are what Python uses to implement generator iterators. They
 
9
are normally created by iterating over a function that yields values, rather
 
10
than explicitly calling :cfunc:`PyGen_New`.
 
11
 
 
12
 
 
13
.. ctype:: PyGenObject
 
14
 
 
15
   The C structure used for generator objects.
 
16
 
 
17
 
 
18
.. cvar:: PyTypeObject PyGen_Type
 
19
 
 
20
   The type object corresponding to generator objects
 
21
 
 
22
 
 
23
.. cfunction:: int PyGen_Check(ob)
 
24
 
 
25
   Return true if *ob* is a generator object; *ob* must not be *NULL*.
 
26
 
 
27
 
 
28
.. cfunction:: int PyGen_CheckExact(ob)
 
29
 
 
30
   Return true if *ob*'s type is *PyGen_Type* is a generator object; *ob* must not
 
31
   be *NULL*.
 
32
 
 
33
 
 
34
.. cfunction:: PyObject* PyGen_New(PyFrameObject *frame)
 
35
 
 
36
   Create and return a new generator object based on the *frame* object. A
 
37
   reference to *frame* is stolen by this function. The parameter must not be
 
38
   *NULL*.