passing by refference

Donn Cave donn at u.washington.edu
Fri May 16 14:39:24 EDT 2003


Quoth aahz at pythoncraft.com (Aahz):
| In article <87r86zaclk.fsf at charter.net>,
| Doug Quale  <quale1 at charter.net> wrote:

|> ...  Python binding does need to be explained, even if you
|> don't like to use the word value.  How do you explain it?
|
| Here's what I usually say:
|
|     In Python, names contain bindings to objects.  A binding is a
|     reference, but experienced Python programmers do not use "reference"
|     because references are not accessible within Python programs (unlike
|     pointers in C).

Hm. On one hand, it seems to me that reference is quite commonly used
by people who probably think of themselves as experienced Python
programmers.  Some of it you might excuse as a legacy, like "reference
count" or "circular reference", but you'll also read things like
"what I was hoping for is to store the reference (not the value) of ..."
and "that b is actually a reference to the ..."

On the other hand, I don't get the reasoning either.  Are bindings
accessible within Python programs?

Reference continues to be the technical term for this mechanism, binding
is a popular informal term.  Most effective explanations use both terms,
as yours does but without the curious deprecation.  That's my take.

	Donn Cave, donn at u.washington.edu




More information about the Python-list mailing list