Proposed keyword to transfer control to another function

Paul Rubin at nospam.invalid
Sat Jul 18 05:16:29 CEST 2015

Chris Angelico <rosuav at> writes:
> # derived from Paul Rubin's example
> def quicksort(array, start, end):
>      midp = partition(array, start, end)

Heh, forgot to include the base case, as someone pointed out.  Oh well,
it's pseudocode, or something.

>         transfer quicksort(array, midp+1, end)

Overall I like the idea but though it doesn't seem terribly important in
the scheme of things.  

I think the syntax has converged to "return from" which seems good to me.

> Note that this is incompatible with 'try' and 'with' blocks, and is

Maybe something can be done about that.

> Is there anything that I've missed out in speccing this up? I've a
> suspicion that this might turn out to be as complicated as 'yield
> from' in all its handling of edge cases.

Seems worthy of more thought.

More information about the Python-list mailing list