why () is () and [] is [] work in other way?

Tim Delaney timothy.c.delaney at gmail.com
Mon Apr 23 20:24:18 EDT 2012


On 24 April 2012 10:18, Robert Kern <robert.kern at gmail.com> wrote:

> On 4/24/12 1:03 AM, Tim Delaney wrote:
>
>> On 24 April 2012 09:08, Devin Jeanpierre <jeanpierreda at gmail.com
>> <mailto:jeanpierreda at gmail.com**>> wrote:
>>
>>    On Mon, Apr 23, 2012 at 6:26 PM, Tim Delaney
>>    <timothy.c.delaney at gmail.com <mailto:timothy.c.delaney@**gmail.com<timothy.c.delaney at gmail.com>>>
>> 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".


No - I was addressing "they behave identically everywhere ..." in the
quote. NaNs are a case whre they do not behave identically everywhere.

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120424/59e3a864/attachment-0001.html>


More information about the Python-list mailing list