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

Donn Cave donn at u.washington.edu
Thu Jan 5 01:38:05 CET 2006


In article <pan.2006.01.04.22.20.07.836653 at REMOVETHIScyber.com.au>,
 Steven D'Aprano <steve at REMOVETHIScyber.com.au> wrote:

> See what confusing, complicated hoops people have to jump through to
> hammer the round peg of Python's behaviour into the square peg of "call by
> reference"?
> 
> http://effbot.org/zone/call-by-object.htm
> 
> Python does not have references or pointers, except internally where
> Python coders can not get to them. It has names and objects. Keep thinking
> about "call by reference" and you just confuse yourself and others. Think
> about names and objects and it is simple and straight-forward.

I agree that it can be simple and straightforward.  The particular
terms we use have nothing to do with it, though.  Most of us need
a word or two to attach to the concept, because that's how our
brains work, but there are no natural words in the English language
that precisely express Python concepts, and we just have to make
do with one or another of several possible.  It's silly to insist
that one particular word resolves all confusions, and another word
creates them.  It's sort of unfortunate to let this crusade get to
the point where you're upbraiding people who know a great deal about
the matter because they don't use your favorite word.

As other followups have pointed out, the problem is simply not
understanding what "=" does.  While in some obscure way this
may be related to "call by reference" etc., that's certainly not
a helpful digression.  To explain what i =  4 does, we can say

  creates a named reference "i" to 4
  binds the name "i" to 4
  etc.

Any of these is delightfully clear if you already understand it,
which is where most of the born again believers are coming from.
People who don't already understand what's being explained, need
to have a little patience and make sure to test their understanding
with a few experiments.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list