In <[EMAIL PROTECTED]>, Alexander Zatvornitskiy wrote: > class Distribution: > __gr_on_transp=dict() > __ostatok_m=dict() > and so on
Those two dicts are *class variables* not *instance variables*! > And, I want to make full copy of it: > d1=Distribution() > d2=copy.deepcopy(d1) > > But, members-dictionaries are don't copied. For example if I will write: > d1.clear() > which clears all two dictionaries, I will find that d2's dictionaries are also > empty!!! That clears only one dictionary at class level. Which is visible on both instances. class Distribution: def __init__(self): self.__gr_on_transp = dict() self.__ostatok_m = dict() ... This creates *instance variables* which should be deepcopied without problems. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list