function parameter scope python 2.5.2

alex23 wuwei23 at gmail.com
Thu Nov 20 18:48:46 EST 2008


On Nov 21, 9:40 am, J Kenneth King <ja... at agentultra.com> wrote:
> Of course, providing a shallow (or deep as necessary) copy makes it
> work, I'm curious as to why the value passed as a parameter to a
> function outside the class is passed a reference rather than a copy.

You're passing neither a reference nor a copy, you're passing the
object (in this case a list) directly:

http://effbot.org/zone/call-by-object.htm



More information about the Python-list mailing list