What is a function parameter =[] for?

Ned Batchelder ned at nedbatchelder.com
Tue Nov 24 10:27:37 EST 2015


On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote:
> Op 24-11-15 om 15:18 schreef Ned Batchelder:
> 
> > 2) In Python, "value" means, what object does a name refer to, or what
> > object did an evaluation produce.
> 
> I don't think this is correct because that would imply that objects don't
> change values (since the value would be the object).

Sorry, I should have been more precise.  Python documentation suffers from
this two-meaning world also.  There are places where "value" is used in
this second sense, perhaps more places than you realize.  I know when I
wrote "Python Names and Values", I meant it in this second sense.

When you think people's claims about values, or understanding of values
are incorrect, take a moment to decipher which of these two meanings they
are likely using, and see if it more sense.

> When a list is mutated, it's value has changed. That is how the word is
> generally used in python.

I don't know about "generally."  It's true that when a list is mutated, it
is the same referent, but now has a different evalue.  That's what it means
to be mutable.

It's also true that the Python docs, being written in English, will use the
"evalue" sense of the word, mixed together with the "referent" sense of the
word.

And yes, this can be confusing.

--Ned.



More information about the Python-list mailing list