A question on modification of a list via a function invocation

Rustom Mody rustompmody at gmail.com
Wed Sep 6 05:13:44 EDT 2017


On Wednesday, September 6, 2017 at 12:51:25 PM UTC+5:30, Gregory Ewing wrote:
> Rustom Mody wrote:
> > 2. is — machine representation, too fine to be useful
> 
> Disagree - "is" in Python has an abstract definition that
> doesn't depend on machine representation.
> 
> -- 
> Greg

There is this (AFAIAC sophistry) in the docs describing the data model
https://docs.python.org/3/reference/datamodel.html

| Every object has an identity, a type and a value. An object’s identity never 
| changes once it has been created; you may think of it as the object’s address 
| in memory. The ‘is’ operator compares the identity of two objects; the id() 
| function returns an integer representing its identity.

| CPython implementation detail: For CPython, id(x) is the memory address where 
| x is stored.

Can you explain what "id" and "is" without talking of memory?

In fact we have got so used to the term 'memory' that it actually seems strange when 
someone like Dijkstra grumbles at the anthropomorphism and asks why its not called 'store'.



More information about the Python-list mailing list