[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [pygame] Newb question: copies vs references



import copy

y = copy.copy(y)
 for a "shallow copy" (one-level)
 or
y = copy.deepcopy(y),
 if you want to recursively copy all elements.

m

-----Original Message-----
From: owner-pygame-users@seul.org [mailto:owner-pygame-users@seul.org]On
Behalf Of David Gudlaugsson
Sent: Wednesday, March 27, 2002 2:04 PM
To: pygame-users@seul.org
Subject: [pygame] Newb question: copies vs references


Alright.. here's a newb question but I can't seem to get a handle on it.

If I create an object, how can I create a copy of it instead of a reference?

x = y = Obect()

I want an exact copy and avoid the processing already performed on the
instance.

tia
David

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org