Reference or Value?

andrew cooke andrew at acooke.org
Mon Feb 23 06:14:34 EST 2009


Steven D'Aprano wrote:
> On Sun, 22 Feb 2009 13:37:27 -0300, andrew cooke wrote:
>
>> as far as i understand things, the best model is:
>>
>> 1 - everything is an object
>> 2 - everything is passed by reference
>
> Except that is wrong. If it were true, you could do this:
[pointer swapping]

i was thinking of how the stack is used; i would have called what you are
talking about "pointer semantics".  however, on reading around a little,
it seems that i'm in a very small minority (which is a pity, because if
you restrict the meaning to how values are handled on the stack then you
get a lot closer to having just values and references, rather than the
whole pile of different terms that are apparently in use).

sorry for the confusion,
andrew





More information about the Python-list mailing list