passing by refference
Fredrik Lundh
fredrik at pythonware.com
Thu May 15 18:25:45 EDT 2003
Joshua Marshall wrote:
> It's only here that I disagree with you. I consider Python values
> themselves to be object references
if you keep inventing your own terminology, you'll never win this
argument:
http://www.python.org/doc/current/ref/objects.html
"Objects, values and types"
_Objects_ are Python's abstraction for data. All data in a
Python program is represented by objects or by relations
between objects.
Every object has an identity, a type and a value. An object's
_identity_ never changes once it has been created; you may
think of it as the object's address in memory. /.../ An object's
_type_ is also unchangeable. It determines the operations that
an object supports (e.g., ``does it have a length?'') and also
defines the possible values for objects of that type. /.../ The
_value_ of some objects can change. Objects whose value can
change are said to be _mutable_; objects whose value is un-
changeable once they are created are called _immutable_.
(this is basically the same terminology as in the CLU papers, except
that they used the term "state" instead of Python's "value")
...so I guess what you've been saying all the time is that Python
uses call-by-identity, not call-by-state. fair enough.
</F>
More information about the Python-list
mailing list