[issue41049] PyObject_RichCompareBool(nan, nan, eq) can be True

2020-06-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the report. I'll add a note to the C API docs. -- assignee: -> rhettinger components: +Documentation -C API nosy: +rhettinger versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue41049] PyObject_RichCompareBool(nan, nan, eq) can be True

2020-06-20 Thread tamuhey
New submission from tamuhey : Applying PyObject_RichCompareBool to two `nan`s can be true if the two nans are same object, i.e. ``` a = float("nan") PyObject_RichCompareBool(a, a, Py_EQ) // True ``` I read the document (https://docs.python.org/3/c-api/object.html?highlight=pyobject_richcompa