proc A def/calls proc B: variable scoping rules.

Steve Holden steve at holdenweb.com
Tue Aug 15 21:51:13 EDT 2006


NevilleDNZ wrote:
> Steve Holden wrote:
> 
>>Hardly surprising. This statement is an assignment to x2, which
>>therefore becomes local to the function. Since no previous value has
>>been assigned to this local, the exception occurs.
> 
> 
> But: In this case the assignment is never reached.... eg..

Doesn't matter. It's not the *execution* of the assignment that makes 
the name local, it's the *existence* of the assignment, detected by 
static code analysis.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list