Last change
on this file was 391, checked in by dmik, 11 years ago |
python: Merge vendor 2.7.6 to trunk.
|
-
Property svn:eol-style
set to
native
|
File size:
919 bytes
|
Rev | Line | |
---|
[2] | 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
|
---|
[391] | 10 | than explicitly calling :c:func:`PyGen_New`.
|
---|
[2] | 11 |
|
---|
| 12 |
|
---|
[391] | 13 | .. c:type:: PyGenObject
|
---|
[2] | 14 |
|
---|
| 15 | The C structure used for generator objects.
|
---|
| 16 |
|
---|
| 17 |
|
---|
[391] | 18 | .. c:var:: PyTypeObject PyGen_Type
|
---|
[2] | 19 |
|
---|
| 20 | The type object corresponding to generator objects
|
---|
| 21 |
|
---|
| 22 |
|
---|
[391] | 23 | .. c:function:: int PyGen_Check(ob)
|
---|
[2] | 24 |
|
---|
| 25 | Return true if *ob* is a generator object; *ob* must not be *NULL*.
|
---|
| 26 |
|
---|
| 27 |
|
---|
[391] | 28 | .. c:function:: int PyGen_CheckExact(ob)
|
---|
[2] | 29 |
|
---|
| 30 | Return true if *ob*'s type is *PyGen_Type* is a generator object; *ob* must not
|
---|
| 31 | be *NULL*.
|
---|
| 32 |
|
---|
| 33 |
|
---|
[391] | 34 | .. c:function:: PyObject* PyGen_New(PyFrameObject *frame)
|
---|
[2] | 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*.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.