Apology Re: Is 'everything' a refrence or isn't it?

Steven D'Aprano steve at REMOVETHIScyber.com.au
Thu Jan 5 20:38:58 EST 2006


On Thu, 05 Jan 2006 11:17:44 -0500, Mike Meyer wrote:

> While telling them that "You can't do call by reference because Python
> is call by object" may be correct, 

Good to see you finally concede it.

> it leaves out the critical information.

As does "call by reference" or "call by value". No three word phrase can
possibly explain Python's behaviour, or any other language for that
matter. You have to know what "call by whatever" *implies* for it to be
meaningful.

> So they're liable to run into the same problem in a
> different context - like the one the OP had.

That doesn't follow. 

The problem isn't that talk about references is *wrong*, but that it is
misleading. Where "reference" is being used just as a generic term, it is
barely acceptable, but any time it is used in a context where it could be
misconstrued is dangerous precisely because people WILL misunderstand it,
because they *think* they know what references (assignment, call by
reference, whatever) means in this context.

The fact that call by object is unfamiliar is precisely its advantage.
Instead of people jumping to conclusions about what it means, like they do
with "reference", they will stop and think and if need be look for further
information about Python's object model. At the very least, they won't say
"Everything in Python is a reference, so this should work, but it
doesn't". 


-- 
Steven.




More information about the Python-list mailing list