On Tue, Oct 25, 2011 at 1:50 PM, Alan Meyer <amey...@yahoo.com> wrote: >> Python will copy something only when you tell it to copy. A simple way >> of copying a list is to slice it: >> >> someList = self._someList[:] > > And another simple way: > > ... > someList = list(self._someList) > ...
I generally prefer the latter. It's clearer, and it guarantees that the result will be a list, which is usually what you want in these situations, rather than whatever unexpected type was passed in. Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list