On Jun 6, 6:40 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote:
> Hi Diez,
>
> Thanks, I thought it worked similar to C++ where a higher compound
> could access a lower section.
It can 'access a lower section'; what it can't do is *change* that
'lower section'; in your example case with an int, this
Hi Diez,
Thanks, I thought it worked similar to C++ where a higher compound
could access a lower section. But as it is not straight forward, I
think it is better to embed the functionality inside a class, and make
it a member variable .. now why didn't I think of that ;-)
Thanks,
- Jorgen
On 6/6
Jorgen Bodde wrote:
> Hi all,
>
> I wanted to solve a small problem, and I have a function that is
> typically meant only as a function belonging inside another function.
>>From the inner function I want to access a variable from the outer
> function like;
>
> def A():
> some_var = 1
> def B