[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Concerning copy



On 4/22/06, Kevin Turner <darian@xxxxxxxxxxxxx> wrote:
> Recently I encountered an issue where Python would, instead of creating
> a new object, instead reference the original one. Using copy.copy() is
> a solution, but I'd much rather be able to toggle off the weird
> referencing that Python has been using and make exceptions as
> necessary. Is there any way to do this?

Now don't take this the wrong way, but you should instead take a look
at your design decisions. Not making a copy is almost always the
sensible thing, from a design perspective, but also from a performance
perspective, because making copies is expensive. I think you should
take a look at other games' code and see how other people are doing
things. I know I've written over a hundred thousand lines of Python,
and I've needed copy.copy() maybe once or twice.

--
Sami Hangaslammi