Setting a class attribute with a given name in python while defining the class
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): passsetattr(A, property, value)
Otherwise, that thing Ignacio just said about metaclasses.