Re: Force exception on attribute write access only one object

2009-01-10 Thread Peter Otten
Thomas Guettler wrote: > Peter Otten schrieb: >> 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. >> class A(object): >> def __i

Re: Force exception on attribute write access only one object

2009-01-09 Thread Thomas Guettler
Hi Peter and others, your idea was good, but it does not work with Django ORM Models: Traceback (most recent call last): File "/localhome/modw/django/core/handlers/base.py", line 87, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/localhome/modw/foo/

Re: Force exception on attribute write access only one object

2009-01-08 Thread Peter Otten
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. Why? > This should raise an exception: > > myobj.foo=1 > > Background: > Somewhere this v

Re: Force exception on attribute write access only one object

2009-01-08 Thread Chris Rebert
On Thu, Jan 8, 2009 at 1:38 AM, Thomas Guettler wrote: > Hi, > > 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: > > myobj.foo=1 >

Force exception on attribute write access only one object

2009-01-08 Thread Thomas Guettler
Hi, 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: myobj.foo=1 Background: Somewhere this value gets changed. But I don't now where.