This article[0] and a clarifying comment[1] answer the question for JS. I think it's the same for Python. Apparently your model (which was mine, too) is out of date!
[0] https://hacks.mozilla.org/2015/05/es6-in-depth-generators/
[1] https://hacks.mozilla.org/2015/05/es6-in-depth-generators/#c...