I am trying to do something like this:
property = \'name\'
value = Thing()
class A:
setattr(A, property, value)
other_thing = \'normal attribute\'
def __i
This may be because the class A
is not fully initialized when you do your setattr(A, p, v)
there.
The first thing to try would be to just move the settattr down to after you close the class
block and see if that works, e.g.
class A(object):
pass
setattr(A, property, value)
Otherwise, that thing Ignacio just said about metaclasses.