At 18:33 28.02.2004 +0100, Diez B. Roggisch wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
> > Thanks for the quick reply Diez! But your code gives
> > the same results as my original, despite the removal
> > of the conflict with the built-in 'list'
>I just tested that - on jython, you are right. On python 2.1, it works as I
>said - and that was what I used to test it.
> > now we have asssigned to a completely new list.
> > I think I am right in saying copying in python is a
> > nightmare!
>Not in python - in jython :) However, deepcopies are always a pain.
>But it looks to me that list(<some-list>) doesn't return a freshly created
>list, as this is done in python. Could be a bug.
yes, already fixed in CVS, was kind of embarrising but the typical idiom for
copying a list is lst[:] and typical Python code mostly never import copy
or do much else
than lst[:] and dic.copy().