A name refers to an object, an object has a value, equality compares values (was: What is a function parameter =[] for?)

Ben Finney ben+python at benfinney.id.au
Tue Nov 24 21:17:35 EST 2015


Laura Creighton <lac at openend.se> writes:

> If I had a time machine, I would go back to early days of Python and
> ban the use of the term 'assignment' and 'value' both. I would insist
> that the term 'binding' be used instead, though if you want to use the
> verb refer, to be synonymous with bind, well, I think that would work.

+1

> (If not, next trip with the time machine, I ban that one as well.)

I've never been able to remember where the keys are kept; I'm sure they
keep being moved by previous drivers.

> It is crystal clear than people on this list mean very different
> things when they use the term 'value', and every one of them thinks
> that Python agrees with them. Cutting this knot may require a new
> word.

Indeed, in the past I used the term “value” as synonymous (in Python
context) with the term “object”. I have become convinced through this
discussion that I should no longer use the terms that way.

Instead, an object *has* a value at a point in time; if the object's
value can change, we say the object is mutable.

The syntax for literals describe a value, but the object once created
may change its value.

Typically, ‘is’ compares object identity; ‘==’ compares object value.

The concepts are distinct, so I apologise for misleadingly conflating
them in my terminology.

-- 
 \             “Skepticism is the highest duty and blind faith the one |
  `\               unpardonable sin.” —Thomas Henry Huxley, _Essays on |
_o__)                                   Controversial Questions_, 1889 |
Ben Finney




More information about the Python-list mailing list