Values and objects
Marko Rauhamaa
marko at pacujo.net
Fri May 9 18:34:58 EDT 2014
Mark H Harris <harrismh777 at gmail.com>:
> Typically when I think about variables (particularly from the
> past, say Pascal, Basic, C, Fortran, Cobol &c) I am thinking about
> modeling memory is some way where the variable (some naming
> convention) is a value handle or value pointer of some chunk of memory
> (by type | length) --- where I am creating a 'box' into which I may
> place something (usually some native type).
>
> When I think of Python's 'variables' (and I don't believe Python
> has variables) I am now thinking of a naming convention (for handling
> objects) where I am not the least interested in modeling memory for
> native types. I am instead interested in modeling the real world (or
> subset) with object abstractions. I am no longer interested in
> creating a 'box' into which I may place some type. I don't need
> variables any longer for that purpose. What I want is some very
> efficient naming convention whereby I can handle the objects I am
> constructing (for whatever abstract purpose).
Right, Python's variables aren't like variables in C. Rather, Python's
variables are like CPU registers. They cannot hold typed or structured
objects and you can't pass references to them.
Marko
More information about the Python-list
mailing list