watching mutables?

Anton Vredegoor anton at vredegoor.doge.nl
Fri Sep 27 16:12:05 CEST 2002


Hello all,

here's a function I would like to have:

<hypothetical code>

>>> m = [1,2]
>>> m
>>> [1,2]
>>> from watcher import watch
>>> watch(m)
>>> m.append(3)
>>> "hey, you changed variable m!, new value is [1,2,3]"

</hypothetical code>

Is this possible? How would this be called?

Anton.



More information about the Python-list mailing list