Values and objects

Ben Finney ben at benfinney.id.au
Fri May 9 20:24:18 EDT 2014


Marko Rauhamaa <marko at pacujo.net> writes:

> Right, Python's variables aren't like variables in C. Rather, Python's
> variables are like CPU registers.

What is the salient difference between those two? I don't see the point
of the distinction.

Why have you chosen an analogy – CPU registers – that still uses the
misleading “copies in containers” model, rather than the “sticky-notes
on objects” model? The latter more accurately describes Python's
references.

> They cannot hold typed or structured objects

This is quite false. Every object in Python is typed and structured, and
to the extent that Python has “variables”, they always refer to a typed
and structured object.

-- 
 \     “Do unto others twenty-five percent better than you expect them |
  `\      to do unto you. (The twenty-five percent is [to correct] for |
_o__)                            error.)” —Linus Pauling's Golden Rule |
Ben Finney




More information about the Python-list mailing list