Thanks for you reply.
I added locals() to my exec statment, so it worked, but I wasn't so sure
about my interpretation of the problem.
Fredrik Lundh wrote:
> N. Pourcelot wrote:
>
>
>>I can't understand some specific behaviour of the exec statment.
>>
>>For example, say that I create such a cl
N. Pourcelot wrote:
> I can't understand some specific behaviour of the exec statment.
>
> For example, say that I create such a class A :
>
> class A:
> def __init__(self):
> self.n = 3
> self.m = None
> def h(self, ini):
> n = self.n
> m = self.m
>
Hello,
I can't understand some specific behaviour of the exec statment.
For example, say that I create such a class A :
class A:
def __init__(self):
self.n = 3
self.m = None
def h(self, ini):
n = self.n
m = self.m
if ini: exec("def m(x): retu