I see, intuitively one would think it would try to get it from global
context as it's not yet bound in the local.
Thanks for the explanation.
Sebastjan
On Sat, Jun 21, 2008 at 5:48 AM, Dan Bishop <[EMAIL PROTECTED]> wrote:
> On Jun 20, 7:32 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
>> Sebast
On Jun 20, 7:32 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
> Sebastjan Trepca wrote:
> > Hey,
>
> > can someone please explain this behavior:
>
> > The code:
>
> > def test1(value=1):
> > def inner():
> > print value
> > inner()
>
> > def test2(value=2):
> > def inner():
> >
Sebastjan Trepca wrote:
> Hey,
>
> can someone please explain this behavior:
>
> The code:
>
> def test1(value=1):
> def inner():
> print value
> inner()
>
>
> def test2(value=2):
> def inner():
> value = value
> inner()
>
> test1()
> test2()
>
> [EMAIL PROTEC
Hey,
can someone please explain this behavior:
The code:
def test1(value=1):
def inner():
print value
inner()
def test2(value=2):
def inner():
value = value
inner()
test1()
test2()
[EMAIL PROTECTED] ~/dev/tests]$ python locals.py
1
Traceback (most recent call