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) -- http://mail.python.org/mailman/listinfo/python-list