Explanation of list reference

Chris Angelico rosuav at gmail.com
Sat Feb 15 13:24:06 CET 2014

On Sat, Feb 15, 2014 at 11:18 PM, Gregory Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> Chris Angelico wrote:
>> But yes, this is an expression, and it evaluates to a reference.
> Well, *all* expressions in Python evaluate to references,
> so that's not really saying much.

Because everything in Python is an object, and objects always are
handled by their references. This wouldn't be true in every language
(eg it's not true of Java's unboxed types), but it's intrinsic to
Python's object model.


More information about the Python-list mailing list