On 4/24/12 1:03 AM, Tim Delaney wrote:
On 24 April 2012 09:08, Devin Jeanpierre <[email protected] <mailto:[email protected]>> wrote:On Mon, Apr 23, 2012 at 6:26 PM, Tim Delaney <[email protected] <mailto:[email protected]>> wrote: > And doing that would make zero sense, because it directly contradicts the > whole *point* of "is". The point of "is" is to tell you whether or not two > references are to the same object. This is a *useful* property. It's useful for mutable objects, yes. How is it useful for immmutable things? They behave identically everywhere where you don't directly ask the question of "a is b" or "id(a) == id(b)". Not always. NaNs are an exception - they don't even compare equal to themselves. And hence a very good reason why "is" and == are separate operations.
I think you misread what Devin wrote. "id(a) == id(b)" not "a == b". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
