i wanted to know the difference between copy composed objects and
independent objects


composed objects

>>> firstserie = all_2_digests([’EcoRI’, ’HindIII’, ’BamHI’])

>>> firstserie

[[’EcoRI’, ’HindIII’], [’EcoRI’, ’BamHI’], [’HindIII’, ’BamHI’]]

>>> newserie = firstserie[1:]

>>> newserie

[[’EcoRI’, ’BamHI’], [’HindIII’, ’BamHI’]]

>>> newserie[1][0]=’SarI’

>>> newserie

[[’EcoRI’, ’BamHI’], [’SarI’, ’BamHI’]]

>>> firstserie

[[’EcoRI’, ’HindIII’], [’EcoRI’, ’BamHI’], [’SarI’, ’BamHI’]]


independent objects

  >>> firstserie = all_2_digests([’EcoRI’, ’HindIII’, ’BamHI’])

>>> firstserie

[[’EcoRI’, ’HindIII’], [’EcoRI’, ’BamHI’], [’HindIII’, ’BamHI’]]

>>> import copy

>>> newserie = copy.deepcopy(firstserie)[1:]

>>> newserie

[[’EcoRI’, ’BamHI’], [’HindIII’, ’BamHI’]]

>>> newserie[1][0]=’SarI’

>>> newserie

[[’EcoRI’, ’BamHI’], [’SarI’, ’BamHI’]]

>>> firstserie

[[’EcoRI’, ’HindIII’], [’EcoRI’, ’BamHI’], [’HindIII’, ’BamHI’]]


i want to know the difference in the context of this program

-- 
madhuri :)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to