Explanation of list reference

Rustom Mody rustompmody at gmail.com
Sat Feb 15 01:24:25 EST 2014


On Saturday, February 15, 2014 11:45:00 AM UTC+5:30, Steven D'Aprano wrote:
> On Fri, 14 Feb 2014 17:55:52 -0800, Rustom Mody wrote:

> > My own preference: No is operator; only id when we deliberately need to
> > poke into the implementation.
> > Of course I am in a miniscule minority I guess on that :-)

> If I have understood you, I think that's a poor way of looking at it. We 
> can have an `is` operator to determine whether or not two objects are the 
> same, without having a concept of object IDs; but you can't have a 
> concept of object IDs without having distinct objects. `is` is more 
> fundamental than id().


Pick is or id. Matters little
To define either you need the notion of 'same'

> IDs are a proxy for distinct objects. If you live in a country with an ID 
> card of some sort, then the IDs acts as an identifier for each unique 
> individual. But countries without ID cards don't lack unique individual 
> people.

With humans like Chris' dice the notion of 'same' is unexceptionable
[well sci-fi, teleportation etc aside :-) ]

To define is or id or same you need to
1 use machine details
or
2 do mathematics
or
3 wave our hands -- Dont we all know that same is same? <Wild Wave>

My bet is that python's id/is cannot be defined with 2 so we use a 
combo of 1 and 3



More information about the Python-list mailing list