free and nonlocal variables

Terry Reedy tjreedy at udel.edu
Thu Mar 21 07:55:01 EDT 2013


On 3/21/2013 4:52 AM, bartolome.sintes at gmail.com wrote:
> In Python 3, "free variable" and "nonlocal variable" are synonym terms?

Yes, but that is idiosyncratic to Python.

> Or is there a difference, like "a free variable is a variable that is
> not a local variable, then nonlocal variables and global variables are
 > both free variables"?

I believe that is the usual definition, such as you would find on Wikipedia.

-- 
Terry Jan Reedy




More information about the Python-list mailing list