[Tutor] assignment statements in python

Michael Sullivan michael at espersunited.com
Mon Jun 12 15:56:46 CEST 2006


On Sun, 2006-06-11 at 22:14 -0400, Kermit Rose wrote:
>   Message: 1
> Date: Sun, 11 Jun 2006 06:58:39 -0400
> From: Kent Johnson <kent37 at tds.net>
> Subject: Re: [Tutor] buggy bug in my program
> Cc: tutor at python.org
>  
> Assignment in Python is not a copy, it is a name binding. Assignment
> creates a name for an object. If you assign the same object to two
> names, they both are bound to the same thing. If the object is mutable,
> like a list, changes to the object will be seen regardless of which name
> you use to refer to it.
>  
> ******

In that case, is it possible to copy a variable by value, instead of by
reference, in Python?



More information about the Tutor mailing list