[issue29756] Improve documentation for list methods that compare items by equality
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 <report@bugs.python.org> <http://bugs.python.org/issue29756> _______________________________________
participants (1)
-
Josh Rosenberg