Re: assigning in nested functions

2005-10-10 Thread Antoon Pardon
Op 2005-10-09, jena schreef <[EMAIL PROTECTED]>: > Hi > I have code > > # BEGIN CODE > def test(): > def x(): > print a > a=2 # *** > > a=1 > x() > print a > > test() > # END CODE > > This code fails (on statement print a in def x), if I omit line marked > ***, it works (it print

Re: assigning in nested functions

2005-10-09 Thread Paul Rubin
jena <[EMAIL PROTECTED]> writes: > # BEGIN CODE > def test(): > def x(): > print a > a=2 # *** > a=1 > x() > print a > > test() > # END CODE > > This code fails (on statement print a in def x), if I omit line marked > ***, it works (it prints 1\n1\n). It look like when I assign var

Re: assigning in nested functions

2005-10-09 Thread Fredrik Lundh
"jena" wrote: > I have code > > # BEGIN CODE > def test(): > def x(): > print a > a=2 # *** > > a=1 > x() > print a > > test() > # END CODE > > This code fails (on statement print a in def x), if I omit line marked > ***, it works (it prints 1\n1\n). It look like when I assign vari

Re: assigning in nested functions

2005-10-09 Thread Diez B. Roggisch
jena wrote: > Hi > I have code > > # BEGIN CODE > def test(): > def x(): >print a >a=2 # *** > > a=1 > x() > print a > > test() > # END CODE > > This code fails (on statement print a in def x), if I omit line marked > ***, it works (it prints 1\n1\n). It look like when I assign var

assigning in nested functions

2005-10-09 Thread jena
Hi I have code # BEGIN CODE def test(): def x(): print a a=2 # *** a=1 x() print a test() # END CODE This code fails (on statement print a in def x), if I omit line marked ***, it works (it prints 1\n1\n). It look like when I assign variable in nested function, I cannot acces