manstey a écrit :
> Thanks.
>
> All I want to know is whether the newlist, as a list of instances, is
> modified. I thought equality was the way to go, but is there a simpler
> way? How can I monitor the state of newlist and set a flag if it is
> changed in anyway?
Override the mutators - or jus
Thanks.
All I want to know is whether the newlist, as a list of instances, is
modified. I thought equality was the way to go, but is there a simpler
way? How can I monitor the state of newlist and set a flag if it is
changed in anyway?
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 13 Mar 2007 18:23:24 -0700, manstey wrote:
> 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)
>
> cla
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=Ca