Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Proposed keyword to transfer control to another function Date: Fri, 17 Jul 2015 20:16:29 -0700 Organization: A noiseless patient Spider Lines: 25 Message-ID: <87lheeyx2q.fsf@jester.gateway.sonic.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="4fa08f1ce1db3b0ae8c51611453a050c"; logging-data="19753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AzEWOglxBelkiIodlqMKT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:6xknO/m9edRelvYTPrrT7cv/+Gw= sha1:lfDQLba6aFWuvyWYhJZFfC5yark= Xref: csiph.com comp.lang.python:94048 Chris Angelico 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.