title: Return in generator together with yield
body: <p>In Python 2 there was an error when <code>return</code> was together with <code>yield</code> in a function definition. But for this code in Python 3.3:</p>
  <pre><code>def f():
    return 3
    yield 2
    
  x = f()
  print(x.__next__())
  </code></pre>
  <p>there is no error that <code>return</code> is used in function with <code>yield</code>. However when the function <code>__next__</code> is called then there is thrown exception <code>StopIteration</code>. Why there is not just returned value <code>3</code>? Is this <code>return</code> somehow ignored?</p>