Re: [Python-Dev] terminology for "free variables" in Python

2010-09-09 Thread Nick Coghlan
On Fri, Sep 10, 2010 at 2:43 AM, Eli Bendersky wrote: > def some_func(myparam): >     def internalfunc(): >     return cc * myparam > > CPython infers that in 'internalfunc', while 'myparam' is free, 'cc' is > global because 'cc' isn't bound in the enclosing scope, although according > to the

Re: [Python-Dev] terminology for "free variables" in Python

2010-09-09 Thread Guido van Rossum
On Thu, Sep 9, 2010 at 9:43 AM, Eli Bendersky wrote: > The execution model section of the Python reference manual defines free > variables as follows: > >     "If a variable is used in a code block but not defined there, it is > a free variable" > > This makes sense and fits the academic definitio

[Python-Dev] terminology for "free variables" in Python

2010-09-09 Thread Eli Bendersky
The execution model section of the Python reference manual defines free variables as follows: "If a variable is used in a code block but not defined there, it is a free variable" This makes sense and fits the academic definition. The documentation of the symtable module supports this definiti