Question about Pass-by-object-reference?

fl rxjwg98 at
Tue Jul 22 21:04:09 CEST 2014

I learn Python function call on tutorial. There is a link on this subject.

Although it explains clearly, the figure makes me puzzled.

""Python is different. As we know, in Python, "Object references are passed by 

A function receives a reference to (and will access) the same object in memory as
used by the caller. However, it does not receive the box that the caller is
storing this object in; as in pass-by-value, the function provides its own box and
creates a new variable for itself. Let's try appending again:""

On the figure, it shows that the result is [0, 1]  (Am I right on the figure?)

When I enter the command lines on my computer:
>>> list=[0]
>>> append(list)
>>> print(list)

How to understand my result and that figure?


More information about the Python-list mailing list