My understanding of the generators in Python and ECMAScript is that they are more capable than ordinary generators. For example, both allow for values to passed back into the generator via next()
, and they both allow yielding from another generator (yield from
in Python and yield *
in ES6), two things that aren't needed in generators.
So, given this extended functionality, are generators as implemented in Python and ES6 for all intents and purposes the same as coroutines? Are there any differences?