[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
RE: [pygame] Sprite Collision
- To: <pygame-users@xxxxxxxx>
- Subject: RE: [pygame] Sprite Collision
- From: "John Krukoff" <helot@xxxxxxxxxxx>
- Date: Tue, 1 May 2007 08:53:11 -0600
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Tue, 01 May 2007 10:49:47 -0400
- Importance: Normal
- In-reply-to: <4636B40F.3040900@xepher.net>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- Thread-index: AceLoO7AEI2uR2CYTGuEOi5IOe3h2wAXt2IA
Kris Schnee wrote:
> When all else fails, copy.deepcopy() seems to make Python understand, "I
> want this to have _the same value_ as X now has, not to be a _reference_
> to X."
>
> Kris
I believe Ethan has already covered all the standard ways to work around
this (i.e. list( ), copy module, [:]), but I think that it's worth pointing
out that python is actually quite consistent here: variables are *always*
references. Liberal use of the id( ) function can illustrate such.
---------
John Krukoff
helot@xxxxxxxxxxx