Legitimacy of deepcopy
Eugeni Doljenko
dolzenko at rsu.ru
Fri Jun 4 08:07:05 EDT 2004
More information about the Python-list mailing list
Fri Jun 4 08:07:05 EDT 2004
- Previous message (by thread): Legitimacy of deepcopy
- Next message (by thread): Python 'Lets Me See The Forest'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
There is a list of custom objects. I want do duplicate this list to modify
objects in new list and then compare old and new. I could do it with
deepcopy
class foo:
def __init__(self, str):
self.str = str
old = [foo('str1'), foo('str2')]
import copy
new = copy.deepcopy(old)
But I've found very few deepcopy uses in Python library and other programs,
so I wonder it's possible to do it other, more elegant way.
- Previous message (by thread): Legitimacy of deepcopy
- Next message (by thread): Python 'Lets Me See The Forest'
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list