~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-2.7.12-docs-html/c-api/gen.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
 
 
5
<html xmlns="http://www.w3.org/1999/xhtml">
 
6
  <head>
 
7
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
8
    
 
9
    <title>Generator Objects &mdash; Python 2.7.12 documentation</title>
 
10
    
 
11
    <link rel="stylesheet" href="../_static/classic.css" type="text/css" />
 
12
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
13
    
 
14
    <script type="text/javascript">
 
15
      var DOCUMENTATION_OPTIONS = {
 
16
        URL_ROOT:    '../',
 
17
        VERSION:     '2.7.12',
 
18
        COLLAPSE_INDEX: false,
 
19
        FILE_SUFFIX: '.html',
 
20
        HAS_SOURCE:  true
 
21
      };
 
22
    </script>
 
23
    <script type="text/javascript" src="../_static/jquery.js"></script>
 
24
    <script type="text/javascript" src="../_static/underscore.js"></script>
 
25
    <script type="text/javascript" src="../_static/doctools.js"></script>
 
26
    <script type="text/javascript" src="../_static/sidebar.js"></script>
 
27
    <link rel="search" type="application/opensearchdescription+xml"
 
28
          title="Search within Python 2.7.12 documentation"
 
29
          href="../_static/opensearch.xml"/>
 
30
    <link rel="author" title="About these documents" href="../about.html" />
 
31
    <link rel="copyright" title="Copyright" href="../copyright.html" />
 
32
    <link rel="top" title="Python 2.7.12 documentation" href="../contents.html" />
 
33
    <link rel="up" title="Concrete Objects Layer" href="concrete.html" />
 
34
    <link rel="next" title="DateTime Objects" href="datetime.html" />
 
35
    <link rel="prev" title="Cell Objects" href="cell.html" />
 
36
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 
37
    <script type="text/javascript" src="../_static/copybutton.js"></script>
 
38
    <script type="text/javascript" src="../_static/version_switch.js"></script>
 
39
 
 
40
    
 
41
 
 
42
  </head>
 
43
  <body role="document">  
 
44
    <div class="related" role="navigation" aria-label="related navigation">
 
45
      <h3>Navigation</h3>
 
46
      <ul>
 
47
        <li class="right" style="margin-right: 10px">
 
48
          <a href="../genindex.html" title="General Index"
 
49
             accesskey="I">index</a></li>
 
50
        <li class="right" >
 
51
          <a href="../py-modindex.html" title="Python Module Index"
 
52
             >modules</a> |</li>
 
53
        <li class="right" >
 
54
          <a href="datetime.html" title="DateTime Objects"
 
55
             accesskey="N">next</a> |</li>
 
56
        <li class="right" >
 
57
          <a href="cell.html" title="Cell Objects"
 
58
             accesskey="P">previous</a> |</li>
 
59
        <li><img src="../_static/py.png" alt=""
 
60
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
61
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
62
        <li>
 
63
          <span class="version_switcher_placeholder">2.7.12</span>
 
64
          <a href="../index.html">Documentation</a> &raquo;
 
65
        </li>
 
66
 
 
67
          <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &raquo;</li>
 
68
          <li class="nav-item nav-item-2"><a href="concrete.html" accesskey="U">Concrete Objects Layer</a> &raquo;</li> 
 
69
      </ul>
 
70
    </div>    
 
71
 
 
72
    <div class="document">
 
73
      <div class="documentwrapper">
 
74
        <div class="bodywrapper">
 
75
          <div class="body" role="main">
 
76
            
 
77
  <div class="section" id="generator-objects">
 
78
<span id="gen-objects"></span><h1>Generator Objects<a class="headerlink" href="#generator-objects" title="Permalink to this headline">¶</a></h1>
 
79
<p>Generator objects are what Python uses to implement generator iterators. They
 
80
are normally created by iterating over a function that yields values, rather
 
81
than explicitly calling <a class="reference internal" href="#c.PyGen_New" title="PyGen_New"><code class="xref c c-func docutils literal"><span class="pre">PyGen_New()</span></code></a>.</p>
 
82
<dl class="type">
 
83
<dt id="c.PyGenObject">
 
84
<code class="descname">PyGenObject</code><a class="headerlink" href="#c.PyGenObject" title="Permalink to this definition">¶</a></dt>
 
85
<dd><p>The C structure used for generator objects.</p>
 
86
</dd></dl>
 
87
 
 
88
<dl class="var">
 
89
<dt id="c.PyGen_Type">
 
90
<a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a> <code class="descname">PyGen_Type</code><a class="headerlink" href="#c.PyGen_Type" title="Permalink to this definition">¶</a></dt>
 
91
<dd><p>The type object corresponding to generator objects.</p>
 
92
</dd></dl>
 
93
 
 
94
<dl class="function">
 
95
<dt id="c.PyGen_Check">
 
96
int <code class="descname">PyGen_Check</code><span class="sig-paren">(</span>ob<span class="sig-paren">)</span><a class="headerlink" href="#c.PyGen_Check" title="Permalink to this definition">¶</a></dt>
 
97
<dd><p>Return true if <em>ob</em> is a generator object; <em>ob</em> must not be <em>NULL</em>.</p>
 
98
</dd></dl>
 
99
 
 
100
<dl class="function">
 
101
<dt id="c.PyGen_CheckExact">
 
102
int <code class="descname">PyGen_CheckExact</code><span class="sig-paren">(</span>ob<span class="sig-paren">)</span><a class="headerlink" href="#c.PyGen_CheckExact" title="Permalink to this definition">¶</a></dt>
 
103
<dd><p>Return true if <em>ob</em>&#8216;s type is <em>PyGen_Type</em> is a generator object; <em>ob</em> must not
 
104
be <em>NULL</em>.</p>
 
105
</dd></dl>
 
106
 
 
107
<dl class="function">
 
108
<dt id="c.PyGen_New">
 
109
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyGen_New</code><span class="sig-paren">(</span>PyFrameObject<em>&nbsp;*frame</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyGen_New" title="Permalink to this definition">¶</a></dt>
 
110
<dd><em class="refcount">Return value: New reference.</em><p>Create and return a new generator object based on the <em>frame</em> object. A
 
111
reference to <em>frame</em> is stolen by this function. The parameter must not be
 
112
<em>NULL</em>.</p>
 
113
</dd></dl>
 
114
 
 
115
</div>
 
116
 
 
117
 
 
118
          </div>
 
119
        </div>
 
120
      </div>
 
121
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
 
122
        <div class="sphinxsidebarwrapper">
 
123
  <h4>Previous topic</h4>
 
124
  <p class="topless"><a href="cell.html"
 
125
                        title="previous chapter">Cell Objects</a></p>
 
126
  <h4>Next topic</h4>
 
127
  <p class="topless"><a href="datetime.html"
 
128
                        title="next chapter">DateTime Objects</a></p>
 
129
<h3>This Page</h3>
 
130
<ul class="this-page-menu">
 
131
  <li><a href="../bugs.html">Report a Bug</a></li>
 
132
  <li><a href="../_sources/c-api/gen.txt"
 
133
         rel="nofollow">Show Source</a></li>
 
134
</ul>
 
135
 
 
136
<div id="searchbox" style="display: none" role="search">
 
137
  <h3>Quick search</h3>
 
138
    <form class="search" action="../search.html" method="get">
 
139
      <input type="text" name="q" />
 
140
      <input type="submit" value="Go" />
 
141
      <input type="hidden" name="check_keywords" value="yes" />
 
142
      <input type="hidden" name="area" value="default" />
 
143
    </form>
 
144
    <p class="searchtip" style="font-size: 90%">
 
145
    Enter search terms or a module, class or function name.
 
146
    </p>
 
147
</div>
 
148
<script type="text/javascript">$('#searchbox').show(0);</script>
 
149
        </div>
 
150
      </div>
 
151
      <div class="clearer"></div>
 
152
    </div>  
 
153
    <div class="related" role="navigation" aria-label="related navigation">
 
154
      <h3>Navigation</h3>
 
155
      <ul>
 
156
        <li class="right" style="margin-right: 10px">
 
157
          <a href="../genindex.html" title="General Index"
 
158
             >index</a></li>
 
159
        <li class="right" >
 
160
          <a href="../py-modindex.html" title="Python Module Index"
 
161
             >modules</a> |</li>
 
162
        <li class="right" >
 
163
          <a href="datetime.html" title="DateTime Objects"
 
164
             >next</a> |</li>
 
165
        <li class="right" >
 
166
          <a href="cell.html" title="Cell Objects"
 
167
             >previous</a> |</li>
 
168
        <li><img src="../_static/py.png" alt=""
 
169
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
170
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
171
        <li>
 
172
          <span class="version_switcher_placeholder">2.7.12</span>
 
173
          <a href="../index.html">Documentation</a> &raquo;
 
174
        </li>
 
175
 
 
176
          <li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> &raquo;</li>
 
177
          <li class="nav-item nav-item-2"><a href="concrete.html" >Concrete Objects Layer</a> &raquo;</li> 
 
178
      </ul>
 
179
    </div>  
 
180
    <div class="footer">
 
181
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
 
182
    <br />
 
183
    The Python Software Foundation is a non-profit corporation.
 
184
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
 
185
    <br />
 
186
    Last updated on Sep 20, 2016.
 
187
    <a href="../bugs.html">Found a bug</a>?
 
188
    <br />
 
189
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
 
190
    </div>
 
191
 
 
192
  </body>
 
193
</html>
 
 
b'\\ No newline at end of file'