getattr/setattr q.

Paulo da Silva psdasilvaX at esotericaX.ptX
Tue Apr 3 00:08:42 EDT 2007


Hi!

In a class C, I may do setattr(C,'x',10).

Is it possible to use getattr/setattr for variables not inside
classes or something equivalent? I mean with the same result as
exec("x=10").

Thanks.



More information about the Python-list mailing list