Re: Accessing Function Variables from Sub-functions

2007-10-11 Thread Terry Reedy
"Licheng Fang" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Sorry to dig up this old thread, but I would like to know what's the | rationale is. Why can't a nested function rebind a variable of an | outer function? Because it is debateble whether this is overall a good idea and

Re: Accessing Function Variables from Sub-functions

2007-10-11 Thread Diez B. Roggisch
Licheng Fang wrote: > On Apr 14 2003, 10:30 pm, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Sebastian Wilhelmi wrote: >> > Hi, >> >> > I would like to do the following: >> >> > ---8<---8<---8<---8<--- >> > def test (): >> > count = 0 >> > def inc_count (): >> >

Accessing Function Variables from Sub-functions

2007-10-11 Thread Licheng Fang
On Apr 14 2003, 10:30 pm, Alex Martelli <[EMAIL PROTECTED]> wrote: > Sebastian Wilhelmi wrote: > > Hi, > > > I would like to do the following: > > > ---8<---8<---8<---8<--- > > def test (): > > count = 0 > > def inc_count (): > > count += 1 > > inc_count () >