What is the difference between a coroutine and a continuation and a generator ?
In newer version of Python, you can send values to Generators with generator.send()
, which makes python Generators effectively coroutines.
The main difference between python Generator, and other generator, say greenlet, is that in python, your yield value
can only return back to the caller. While in greenlet, target.switch(value)
can take you to a specific target coroutine and yield a value where the target
would continue to run.