Finding the instance reference of an object

Aaron Brady castironpi at gmail.com
Mon Nov 3 14:00:36 EST 2008


On Nov 2, 10:13 pm, Steven D'Aprano
<ste... at REMOVE.THIS.cybersource.com.au> wrote:
> On Sun, 02 Nov 2008 13:23:11 -0800, Aaron Brady wrote:
> > But, doing so, an object is not the same as a reference to it, and all
> > Python does is pass and copy references.
>
> No, that's what at least one particular implementation of Python does.
> That's not what Python does. The Python VM doesn't have any concept of
> "values" or "references" or "values which are actually references in
> disguise". The Python VM knows about *names in namespaces* and *objects*.
>
> --
> Steven

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



More information about the Python-list mailing list