[Python-ideas] Tweaking closures and lexical scoping to include the function being defined
bruce at leapyear.org
Mon Sep 26 19:32:40 CEST 2011
On Mon, Sep 26, 2011 at 10:16 AM, Devin Jeanpierre
<jeanpierreda at gmail.com>wrote:
> > The keyword nonlocal means that this binding is not local to this scope
> > can be found up the call stack.
> Lexical stack. (The call stack would be dynamic scope. [I suspect you
> already know this; I am pedant
Yeah, I know that but a perfect example of how easy it is to get confused.
> > In contrast, your usage means the binding is
> > local to this function, created before the function is called the first
> > and shared with all calls to this function. Those are orthogonal scopes.
> Not really. Created differently, yes. But after creation it works
> identically, by definition.
To a python developer, sure. To a python programmer, I don't think so.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas