Finding the instance reference of an object

greg greg at cosc.canterbury.ac.nz
Thu Oct 30 20:58:13 EDT 2008


Dale Roberts wrote:

> Okay, you can have it that way, but every time you explain to someone
> that Python passes "By Value", you will have to add the additional
> baggage that, oh, by the way, there is a completely different meaning
> for "value" in Python than what you are used to.

For what it's worth, I happen to agree that telling
someone that Python passes parameters "by value" without
being sure they understand exactly what "by value"
means, is not a good idea -- not because the term
isn't well-defined, but because of the widespread
confusion out there about it.

But equally I wouldn't tell someone that it's *not*
by value, because if they do happen to correctly
understand what it means, that will confuse them just
as much.

So my recommendation is just to tell them that it
works by assigning the result of evaluating the actual
parameter to the formal parameter.

If they understand how assignment works in Python, that
tells them all they need to know.

If they don't understand how assignment works, then they
have a more fundamental knowledge gap that needs to be
corrected first.

-- 
Greg


> 
> Then the questions and puzzled looks will start...
> 
> And when they tell their friend that Joe The Programmer said it's Pass
> By Value, your additional context may not be present any longer, and
> the friend will be very confused.
> 
> In my opinion, best just to head it off and call it something
> different so as not to confuse.
> 
> dale



More information about the Python-list mailing list