title: Difference between `yield from foo()` and `for x in foo(): yield x`
body: <p>In Python most examples of yield from explain it with saying that </p>
  
  <pre><code>yield from foo()
  </code></pre>
  
  <p>is similar to </p>
  
  <pre><code>for x in foo(): yield x
  </code></pre>
  
  <p>On the other hand it doesn't seem to be exactly the same and there's some magic thrown in. I feel a bit uneasy about using a function that does magic that I don't understand. What do I have to know about the magic of <code>yield from</code> to avoid getting into a situation where the magic does something I don't expect? What advantages does the magic provide, that I should be aware of?</p>