From: D-Man <ds...@ri...> - 2001-02-23 14:59:46
|
On Fri, Feb 23, 2001 at 12:42:08PM +0000, ma...@la... wrote: | Adam Burke <ada...@gb...> said: | | > If you want to keep the unsorted data you need to take a copy, ie, y = x. | | Careful: y = x doesn't make a copy, it just assigns another | name for the same list. Use y = x[:] to make a copy. That is only a shallow copy. If you modify the objects in list 'y' afterwards, list 'x' will see the change. If you want a deep copy, there is a module, "copy" I believe, to handle that. -D |