Values and objects

Ethan Furman ethan at stoneleaf.us
Sun May 11 00:46:44 EDT 2014


[accidentally went off-list; sorry]

On 05/10/2014 02:03 PM, Devin Jeanpierre wrote:
>
> spam is referring to a local variable that has not been bound. This is
> not an implementation detail.

The implementation detail is that in cpython there is a spot already reserved for what will be the 'spam' variable, as 
opposed to the module level where no such spots are reserved.

> Because module level variables work differently from local variables.

Not by language definition.  There are pythons where modifying function locals works, but the working or not-working is 
not a language guarantee.

--
~Ethan~



More information about the Python-list mailing list