Re: Nested scopes and class variables

wittempj_at_hotmail.com
Date: 01/31/05


Date: 31 Jan 2005 00:58:42 -0800

To me it seems you should do it something like this:
-def f(x):
- class C(object):
- def __init__(self, x):
- self.x = x # here you set the attribute for class C
- c = C(x) # instantiate a C object
- print c.x

-f(5)