Re: [Tutor] x is a global variable

2009-11-30 Thread Dave Angel
spir wrote: Hello Eike! Eike Welk dixit: Well, this is certainly not specific to closures. i = 0 def f(): i = i+1 print i f() ==> UnboundLocalError Imo, in this case, "i = i+1" is a kind of "paradoxal injonction" (lol! not sure of the exact idiom in english). You tell python both t

Re: [Tutor] x is a global variable

2009-11-30 Thread spir
Hello Eike! Eike Welk dixit: > Hello Spir! > > On Monday 30 November 2009, spir wrote: > > which seems to indicate python really embeds "symbolic references" > > (*) to outer *variables*, when creating a closure for g0. Not > > "pointer references" (**), otherwise the replacement of x would not

Re: [Tutor] x is a global variable

2009-11-30 Thread Eike Welk
Hello Spir! On Monday 30 November 2009, spir wrote: > which seems to indicate python really embeds "symbolic references" > (*) to outer *variables*, when creating a closure for g0. Not > "pointer references" (**), otherwise the replacement of x would not > be seen by the closure --like in the case