Force exception on attribute write access only one object
__peter__ at web.de
Thu Jan 8 12:29:19 CET 2009
Thomas Guettler wrote:
> for debugging I want to raise an exception if an attribute is
> changed on an object. Since it is only for debugging I don't want
> to change the integer attribute to a property.
> This should raise an exception:
> Somewhere this value gets changed. But I don't now where.
If you change your mind:
self.foo = 42
a = A()
b = A()
b.__class__ = B
a.foo = "whatever"
b.foo = "whatever"
More information about the Python-list