how do I detect a change in a list of class instances? from copy import deepcopy
class CaListOfObj(list): """ subclass of list """ def __init__(self, *args, **kwargs): list.__init__(self, *args, **kwargs) class CaClass(object): pass class CaData(object): pass myclass=CaClass() a=CaData() b=CaData() c=CaData() listInstances = CaListOfObj([a,b,c]) setattr(myclass,'initlist',listInstances) setattr(myclass,'newlist',deepcopy(listInstances)) print myclass.initlist == myclass.newlist myclass.newlist.append(c) print myclass.initlist == myclass.newlist gives False False because deep copies of instances are different instances. what I want to do is detect a change between .initlist and .newlist. thanks -- http://mail.python.org/mailman/listinfo/python-list