appending to list

Michael Hudson mwh at python.net
Wed Oct 1 12:26:45 EDT 2003


sud jag <quentapole1 at yahoo.com> writes:

> Hi,
>   Iam a newbie to python. So any help on this is
> deeply appreciated
> 
>   If I append an instance of a class to a list will
> the list have a copy of the instance or just a
> reference to that instance ? If it is only a reference
> is there something similar to deep copy in case of
> append ?

Ooh, I get to post this URL:

    http://starship.python.net/crew/mwh/objectthink.html

again.

In general, I find that I hardly ever *really* want to use the copy
module Alex pointed you at.  Sometimes you do, but you shouldn't reach
for it without due consideration.

Cheers,
mwh

-- 
  The meaning of "brunch" is as yet undefined.
                                             -- Simon Booth, ucam.chat




More information about the Python-list mailing list