Generator Expression vs yield: Why isn't 'next()' working?
<p>I know I must be missing something simple, but I am not seeing it.</p>

<p>If I have a generator expression like this:</p>

<pre><code>&gt;&gt;&gt; serializer=(sn for sn in xrange(0,sys.maxint))
</code></pre>

<p>I can generate, easily, individual integers like this:</p>

<pre><code>&gt;&gt;&gt; serializer.next()
0
&gt;&gt;&gt; serializer.next()
1
&gt;&gt;&gt; serializer.next()
2
</code></pre>

<p>If I write a generator like this:</p>

<pre><code>&gt;&gt;&gt; def ser():
...    for sn in xrange(0,100000):
...       yield sn
</code></pre>

<p>It is no bueno:</p>

<pre><code>&gt;&gt;&gt; ser().next()
0
&gt;&gt;&gt; ser().next()
0
&gt;&gt;&gt; ser().next()
0
</code></pre>

<p>???  What am I missing ???</p>
