watching mutables?

Chris Liechti cliechti at gmx.net
Fri Sep 27 19:24:53 CEST 2002


anton at vredegoor.doge.nl (Anton Vredegoor) wrote in 
news:an211j$oi$1 at news.hccnet.nl:

> On Fri, 27 Sep 2002 09:34:55 -0500, "Mark McEahern"
> <marklists at mceahern.com> wrote:
> 
>>l = Watched()
>>l.append(1)
> 
> Thanks for reacting to my question. However, I am looking for
> something that calls a defineable function if *any* mutable variable
> in the current scope changes. Variables should be 'marked' to install
> this function for them. For example 'watch(m,f)' indicates that
> function f is called if mutable variable m is changed. I do not want
> function f to be a method of object m since I want object m to be
> *any* mutable python object and furthermore I do not want to change
> the orginal object. The call of function f would be triggered by *any*
> change of object m. This would make debugging (and some other things I
> am tinkering with) a lot easier. Is it possible?

see EventObj:
http://oomadness.tuxfamily.org/p-pyobjtools.php

chris
-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list