Explanation of list reference
steve+comp.lang.python at pearwood.info
Sun Feb 16 03:25:54 CET 2014
On Sat, 15 Feb 2014 23:01:53 +0200, Marko Rauhamaa wrote:
> Steven D'Aprano <steve+comp.lang.python at pearwood.info>:
>> On Sat, 15 Feb 2014 18:29:59 +0200, Marko Rauhamaa wrote:
>>> Nowhere do I see the violating "x is y".
>> Do you truly think that there is even the tiniest, most microscopic
>> chance that the int 230000 which has been garbage-collected and no
>> longer exists, and the int 420000, are the same object?
> What were we talking about again?
Two distinct objects with the same id(). I demonstrated a situation where
id(x) == id(y) implies x is y
fails. I explained *twice* how to rescue your claim. In each case you
deleted my explanation, apparently unread. I can only conclude that you
are not actually engaging in this discussion in good faith.
For anyone else reading, id(x) == id(y) implies that x is y only if x and
y exist at the same time, in the same process. Python can re-use IDs, and
you cannot compare IDs from multiple processes.
More information about the Python-list