Is there any way to make a list call a function every time the list is modified?
list
For example:
>>>l = [1, 2, 3] >>>def
I'm almost certain this can't be done with the standard list.
I think the cleanest way would be to write your own class to do this (perhaps inheriting from list).