Hacker News new | ask | show | jobs
by joechung 6100 days ago
What is special about Python's yield statement compared to the ones in Ruby, C#, and other languages?
3 comments

More significantly, continuations are a strict superset of coroutines, so standard Python is actually less powerful in this regard than languages with full continuation support, which if memory serves me includes Ruby, Smalltalk, and Scheme among others.
Python has coroutines as of 2.5: http://www.python.org/dev/peps/pep-0342/
Unfortunately, continuations are not supported in Ruby as of 1.9. They might come back in 2.0 though.
Er, limitations of my knowledge, as I have done more in python than the other two. My bad.
Also Lua
I'm not sure why you were down voted. An excellent overview of coroutines in general, and specifically as they are used in Lua, is http://www.inf.puc-rio.br/~roberto/docs/MCC15-04.pdf