title: Recursion using yield
body: <p>Is there any way to mix recursion and the <code>yield</code> statement? For instance, a infinite number generator (using recursion) would be something like:</p>
  
  <pre><code>def infinity(start):
      yield start
      # recursion here ...
  
  &gt;&gt;&gt; it = infinity(1)
  &gt;&gt;&gt; next(it)
  1
  &gt;&gt;&gt; next(it)
  2
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>def infinity(start):
      yield start
      infinity(start + 1)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>def infinity(start):
      yield start
      yield infinity(start + 1)
  </code></pre>
  
  <p>But none of them did what I want, the first one stopped after it yielded <code>start</code> and the second one yielded <code>start</code>, then the generator and then stopped.</p>
  
  <p><strong>NOTE:</strong> Please, I know you can do this using a while-loop:</p>
  
  <pre><code>def infinity(start):
      while True:
          yield start
          start += 1
  </code></pre>
  
  <p>I just want to know if this can be done recursively.</p>