[Python-Dev] PEP for Better Control of Nested Lexical Scopes

Josiah Carlson jcarlson at uci.edu
Wed Feb 22 03:42:38 CET 2006

"Steven Bethard" <steven.bethard at gmail.com> wrote:
> On 2/21/06, Josiah Carlson <jcarlson at uci.edu> wrote:
> > The question which still remains in my mind, which I previously asked,
> > is whether the use cases are compelling enough to warrant the feature
> > addition.
> I don't know whether I support the proposal or not, but in reading
> Mark Russel's email, I realized that I just recently ran into a use
> case:

[snip example where 3 lines are duplicated twice, and a 2 line subset
are duplicated in a third location]

> using something
> like ``curr_suffix :=`` or Phillip J. Eby's suggestion of
> ``.curr_suffix =`` would allow this code to be factored out into a
> function.

In this particular example, there is no net reduction in line use. The
execution speed of your algorithm would be reduced due to function
calling overhead.  There may be a minor clarification improvement, but
arguably no better than the Richie Hindle's functional goto
implementation for Python 2.3 and later.

 - Josiah

More information about the Python-Dev mailing list