Steven Bethard escreveu: > Paulo da Silva wrote: ... > If you're at the module level, you can do:: > > globals()['x'] = 10 > > If you're inside a function, you probably want to look for another way > of doing what you're doing. > > What's the actual task you're trying to accomplish here?
None. I asked just for curiosity. My problem has to do with the normal case of a class or class instance. When I saw setattr/getattr as the way to solve my problem I just felt curiosity on if and how it could be done outside a class. Thank you very much for your response. Paulo -- http://mail.python.org/mailman/listinfo/python-list