On Feb 19, 1:45 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Asun Friere" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED]
> | The advice not to identity test strings and numbers (since they are > | interred in the main implementation), > > They may or may not be. Obviously, and that is the problem. The behaviour will appear inconsistent unless one is familiar with the conditions under which they are or are not. So since the numbers and strings are interned (under certain conditions), it is probably best not to identity test them. > > Ditto for tuples, unless possibly when they have mutable members. > Which is the reason that they are never interned in CPython, no? So I was wrong, the categorical avoidance of identity testing is probably _not_ sound advice with regard to tuples. > | 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). > Sorry I'm a goth, so you can understand my mistake ;= So was that a yes or no? I mean is it even possible for the identity behaviour of mutables to vary between implementations? I can't see how they can possibly be interned, but is there some other factor I'm missing in regard to identity behaviour which could in fact vary between implementations? -- http://mail.python.org/mailman/listinfo/python-list