On Fri, Oct 05, 2012 at 01:00:10AM +0200, Antoine Pitrou wrote:
On Thu, 4 Oct 2012 17:08:40 +0200 Victor Stinner firstname.lastname@example.org wrote:
PyObject_RichCompareBool() implements this optimization which leads to incorrect results:
nan = float("nan") mytuple = (nan,) assert mytuple != mytuple # fails
I think that the optimization should be implemented for Unicode strings, but disabled in PyObject_RichCompareBool().
I think we should wait for someone to complain before disabling it. It's a useful optimization.
I will go to the wall to defend correct IEEE 754 semantics for NANs, but I also support containers that optimise away those semantics by default.
I think it's too early to talk about disabling it without even the report of a bug caused by it.