Pass by reference or by value?

star.public at gmail.com star.public at gmail.com
Fri Jul 13 16:11:43 EDT 2007


On Jul 13, 3:10 pm, Robert Dailey <rcdai... at gmail.com> wrote:
> Hi,
>
> I noticed in Python all function parameters seem to be passed by
> reference. ... [And later otherwise, etc, snip]

Heya. Go read through the thread from yesterday, title starts with
"Understanding Python Functions" -- they go through the whole pass by
object, mutable vs immutable stuff pretty well in there.

Short possibly bad version: Assigning (inclding to a function var)
makes a new name for an object, reassigning (x=...) only changes what
the indvidual name (x) means, but changing the object itself
(x[n]=..., x.n=..., etc) affects anything that has a name for that
object. Names are names, not variables.

--
Weaver[0]=Star




More information about the Python-list mailing list