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

Steve Dower Steve.Dower at microsoft.com
Wed Oct 24 03:53:52 CEST 2012


Since I was the one to first mention the term 'continuation' in this discussion, I'll clarify that I meant it as the "'callback' of sorts", and specifically in the situation where the person writing it does not realise that it is a callback.

For example:

@async
def my_func():
    # part a
    x = yield y
    # part b

Part B is the continuation here - the piece of code that continues after 'y' completes. There are various other pieces involved (a callback and a generator, and possibly others, depending on the implementation) so rather than muddying the waters with adjectives I muddied the waters with a noun. "The rest of the task" is close enough (when used in context) that I'm happy to stick to that. "Callback" is an implementation detail IMO, and not one that is necessary to leak through our abstraction.

(I also didn't realise people were so traumatised by the C-word, or I would have picked another one. Add this to the list of reasons to not learn functional programming... :) )


More information about the Python-ideas mailing list