I learned a bit about coroutines (in the context of Python) today. My understanding of them is they are a generalisation of generators in which you can return to the yield point with an argument. The problem I have is that I’m not quite sure of when they’re useful. I mean, is there some situation when they’re overwhelmingly the best thing to use?
I asked that question here in the context of a specific example, although the answer doesn’t wholly satisfy me.