Question about isinstance()

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Fri Jan 27 18:09:13 EST 2006


Marc 'BlackJack' Rintsch:
>Rene Pijlman:
>> Well no, when comparing against things you didn't think of the __eq__
>> shouldn't return a false False, it should return NotImplemented. After
>> all, the things you didn't think of are not (yet) implemented.
>
>I think Steven thinks that it is possible that you compare to an object of
>a different type which has the same attributes as expected by the
>`__eq__()` method.  If the first test is `isinstance()` for the "correct"
>type you rule out those cases and give a false `False`.

Like I said, it wouldn't return False, it would return NotImplemented.

-- 
René Pijlman



More information about the Python-list mailing list