Message298811
I never understood how container comparison works.
>>> nan = float("nan")
>>> [nan] == [nan]
True
>>> (nan,) == (nan,)
True
>>> nan == nan
False
>>> nan is nan
True
I picked the float NaN because it's one of the weirdest object in Python: it's not equal to itself.
I don't know what is the impact of the proposed change on comparison. Can it break an application? It's unclear to me.
--
It also recalls me an optimization I proposed on string: begin with comparison on the hash, if the two hashs are already known. At the end, we decided that it wasn't worth it.
--
Raymond, Tim and Serhiy don't seem to be convince, so I will follow them and agree to reject this optimization :-) |
|
Date |
User |
Action |
Args |
2017-07-21 16:02:02 | vstinner | set | recipients:
+ vstinner, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, wbolster |
2017-07-21 16:02:02 | vstinner | set | messageid: <1500652922.84.0.263914110405.issue30907@psf.upfronthosting.co.za> |
2017-07-21 16:02:02 | vstinner | link | issue30907 messages |
2017-07-21 16:02:02 | vstinner | create | |
|