"Asun Friere" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
| On Feb 19, 9:44 am, Steven D'Aprano <[EMAIL PROTECTED]
| cybersource.com.au> wrote:
|
| > Except for documented singletons such as modules and None, which 
objects
| > have the same identity is platform dependent, version dependent, and 
even
| > dependent on the execution history of your code.
|
| The advice not to identity test strings and numbers (since they are
| interred in the main implementation),

They may or may not be.  But for almost all purposes, that is irrelevant.

| or tuples, since they  potentially could be, seems sound enough.

Ditto for tuples, unless possibly when they have mutable members.

|  But given the nature of
| immutables, is the identity of these even potentially implementation
| dependant (ie. they couldn't be interred could they)?

The word is 'interned', not 'interred' (buried).

| One might
| conceivably want to know that a list into which one is about to stuff
| something is the same (or perhaps not the same) list as that pointed
| to by another name, which operation, hopefully, remains possible
| across the range of potential implementations.

Lists are mutable, and identity is often important.  Id(list) can be used 
to debug or solve puzzling behavior.

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to