When defining class attributes through "computed" names, as in:
class C(object):
for name in (....):
exec("%s = ..." % (name,...))
Is there a different way to handle multiple attribute definitions than using exec? getattr (C, name) does not work, because C is not defined during class construction ...
source
share