list modification subclassing

manstey manstey at csu.edu.au
Sun May 20 20:55:52 EDT 2007


Hi,

I have a simple subclass of a list:

class CaListOfObj(list):
    """ subclass of list """
    def __init__(self, *args, **kwargs):
        list.__init__(self, *args, **kwargs)

a= CaListOfObj([1,2,3])

How do I write a method that does something EVERY time a is modified?

Thanks




More information about the Python-list mailing list