Josh Rosenberg added the comment:

Steven: Technically, in CPython, they use both identity and equality testing, 
as a function of using RichCompareBool (which tests identity first, then 
equality), rather than RichCompare (which only tests equality).

It makes a difference for stuff like NaN values, where describing it as 
equality only would imply that:

nan = float('nan')
([nan] * 10).count(nan)

produces 0 (because nan is equal to nothing, including itself), when in fact it 
produces 10 (because we reused the same nan object, and the identity test 
passed).

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29756>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to