[Python-ideas] yield from multiple iterables (was Re: The async API of the future: yield-from)

Sam Rushing sam-pydeas at rushing.nightmare.com
Wed Oct 24 02:58:16 CEST 2012


On 10/23/12 5:24 PM, Christian Tismer wrote:
>
> As used quite often, the definition is more like "half a coroutine",
> that means the part that can resume it at some point.
> Sticking two together, you get a coroutine (tasklet, greenlet etc).
> The are one-shot continuations, they are gone after resuming.
>
> The meaning in Scheme is much weider, and you were right to be scared.
> In Scheme, these beasts survive their reactivation as a constant.
> My big design error in 1998 was to implement exactly those full
> continuations for Python.
>
> I'm scared myself when I recall that ... ;-)
>
Come on Christian, take the red pill and see how far down the rabbit
hole goes... 8^)

https://github.com/samrushing/irken-compiler

I never noticed before, but there really are two different meanings to
'continuation':

1) in the phrase 'continuation-passing style', it means a 'callback' of
sorts.
2) as a separate term, it means an object that represents the future of
a computation.

Like Greg said, you can apply the CPS transformation to any bit of code
(or write it that way from the start), and when you do you might be
tempted to refer to your callbacks as 'continuations'.

-Sam




More information about the Python-ideas mailing list