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

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Oct 24 07:06:36 CEST 2012


Sam Rushing wrote:

> 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.

They're not really different things. When you call a continuation
function in a continuation-passing style program, you're effectively
invoking *all* of the rest of the computation, not just the part
represented by that function.

This becomes particularly clear if you're able to make the
continuation calls using tail calls. Then it's not so much a
"callback" as a "callforward". Nothing ever returns, so forward
is the only way to go!

-- 
Greg



More information about the Python-ideas mailing list