Message289243
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). |
|
Date |
User |
Action |
Args |
2017-03-08 15:35:23 | josh.r | set | recipients:
+ josh.r, barry, steven.daprano, docs@python, Alexander Todorov |
2017-03-08 15:35:23 | josh.r | set | messageid: <1488987323.45.0.697958840526.issue29756@psf.upfronthosting.co.za> |
2017-03-08 15:35:23 | josh.r | link | issue29756 messages |
2017-03-08 15:35:23 | josh.r | create | |
|