Is 'everything' a refrence or isn't it?

Bryan Olson fakeaddress at nowhere.org
Sat Jan 7 06:20:25 EST 2006


Steven D'Aprano wrote:
> On Thu, 05 Jan 2006 05:21:24 +0000, Bryan Olson wrote:
> 
> 
>>Steven D'Aprano wrote:
>>
>>>Mike Meyer wrote:
>>
>>[...]
>>
>>>>Correct. What's stored in a list is a reference.
>>>
>>>Nonsense. What is stored in the list is an object.
>>
>>According to the Python Language Reference:
>>
>>     Some objects contain references to other objects; these are
>>     called containers. Examples of containers are tuples, lists
>>     and dictionaries.
>>     [http://docs.python.org/ref/objects.html]
> 
> 
> Is it so hard to understand that the word "reference" has a general,
> imprecise meaning in common English (which is clearly how the quote
> above is using the word) while still having in the context of assignment
> and argument passing a more precise meaning which is dangerously
> misleading?

What's pretty easy to understand at this point, is that Mike
was right and you were wrong. "Reference" has a precise meaning
here, it's what the Python language uses, and contrary to your
reporting, it's what the rest of the discipline uses.



> Words are important -- not only for what they mean, but for what the
> connotations they carry. For people who come to Python from C-like
> languages, the word "reference" means something that is just not true in
> the context of Python's behaviour.

Wrong. C does not have references, and the Python use is consistent
with the rest of computer science. You seem to have read in things
that it does not mean. Fix *your* thinking.


  That's why people come to Python with a
> frame that tells that what call by reference implies ("I can do this...")
> and then they discover that they often *can't* do that.

I'm sorry if you got confused, but please don't project it on
the rest of the discipline. C does not have even references.

[...]
> Thinking about Python's behaviour ("it always passes references to
> objects")

Just fix your thinking and don't attribute these problems to
others.

[...]
> If we were writing academic papers, we could define "call by reference"
> and "objects contain references" any way we liked,

That would be a terrible thing to do. Just learn to use the
meaning accepted in the discipline, and used in the Python doc.

-- 
--Bryan



More information about the Python-list mailing list