[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~
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to