Re: Curious UnboundLocalError Behavior

2007-03-01 Thread Matthew Franz
I had tried the global prefix in the real code (vs. the contrived example in the post), but in the incorrect code block, which made me think something else was up. Yes, these were supposed to be constants that under rare circumstances were changed ;) In the end, I scrapped the rebind approach, be

Re: Curious UnboundLocalError Behavior

2007-03-01 Thread [EMAIL PROTECTED]
On 28 fév, 18:15, "Matthew Franz" <[EMAIL PROTECTED]> wrote: > I'm probably fundamentally misunderstanding the way the interpreter > works with regard to scope, but is this the intended behavior... > (snip traceback) > import os,sys > > SOMEGLOBAL=1 > > def foo(): > dome=False > if dome: >

Re: Curious UnboundLocalError Behavior

2007-02-28 Thread Daniel Nogradi
> I'm probably fundamentally misunderstanding the way the interpreter > works with regard to scope, but is this the intended behavior... > [] > SOMEGLOBAL: > Traceback (most recent call last): > File "unboundlocal.py", line 15, in ? > foo() > File "unboundlocal.py", line 11, in foo >

Curious UnboundLocalError Behavior

2007-02-28 Thread Matthew Franz
I'm probably fundamentally misunderstanding the way the interpreter works with regard to scope, but is this the intended behavior... franz-macbook:~ mdfranz$ python unboundlocal.py ('Darwin', 'franz-macbook.local', '8.8.5', 'Darwin Kernel Version 8.8.5: Mon Dec 11 19:39:17 PST 2006; root:xnu-792.1