Explaining names vs variables in Python
Steven D'Aprano
steve at pearwood.info
Wed Mar 2 12:23:19 EST 2016
On Thu, 3 Mar 2016 01:11 am, Marko Rauhamaa wrote:
> What is missing is the rules that are obeyed by the "is" operator.
I think what is actually missing is some common bloody sense. The Python
docs are written in English, and don't define *hundreds*, possible
*thousands* of words because they are using their normal English meaning.
The docs for `is` say:
6.10.3. Identity comparisons
The operators is and is not test for object identity: x is y is true if and
only if x and y are the same object. x is not y yields the inverse truth
value.
https://docs.python.org/3/reference/expressions.html#is-not
In this case, "same object" carries the normal English meaning of "same" and
the normal computer science meaning of "object" in the sense of "Object
Oriented Programming". There's no mystery here, no circular definition.
--
Steven
More information about the Python-list
mailing list