explicit variable scoping

JCM joshway_without_spam at myway.com
Mon Mar 22 15:48:18 EST 2004


Sean Ross <sross at connectmail.carleton.ca> wrote:

> "David MacQuigg" <dmq at gain.com> wrote in message
> news:blbu505vrj35i52ari8a0uivja0pp7a9qu at 4ax.com...

>> If we want to set variables in intermediate scopes, I would prefer a
>> syntax like:
>>
>> b = 1
>> def f():
>> a = 2
>> def g():
>> global.f.a = 3

Locals inside functions are unique to a function invocation (not the
function object).  More than one may be active at any given time,
either through recursion or by creating closures.



More information about the Python-list mailing list