Finding the instance reference of an object

Hendrik van Rooyen mail at microcorp.co.za
Mon Nov 3 15:57:56 EST 2008


"Aaron Brady" <castironpi at gmail.com> wrote:

>I think we can conclude that Python passes by reference, since a
>function can modify objects that were passed in to it.

Sort of - if the modification is by "side effect" - so you
can append to a list, for instance.

However, if you use the passed param name on the left
of an assignment statement, you get a new local object.
I think it is this that lies at the root of the confusion.

- Hendrik






More information about the Python-list mailing list