setting attributes during class construction

1
2
3
4
5
6
>>> class A(object):
... for i in xrange(10):
... locals()['a%d' % i] = i
...
>>> A.a
A.a0 A.a1 A.a2 A.a3 A.a4 A.a5 A.a6 A.a7 A.a8 A.a9