Explanation of list reference
Marko Rauhamaa
marko at pacujo.net
Fri Feb 14 15:58:15 EST 2014
Ian Kelly <ian.g.kelly at gmail.com>:
> This is nonsense. Python the language makes no such distinction
> between "big" and "small" values. *All* objects in CPython are stored
> internally on the heap. Other implementations may use different memory
> management schemes.
You're right, of course. Conceptually, the "everything is a reference"
and the "small"/"big" distinction are equivalent (produce the same
outcomes). The question is, which model is easier for a beginner to
grasp.
Say you write:
1 + 2
You may not find it most intuitive to follow through the object
instantiation and reference manipulation implicit in the "everything is
a reference" model when you think you understand numbers but have little
idea of memory, objects, heap, allocation etc.
Marko
More information about the Python-list
mailing list