New submission from tamuhey <tamu...@gmail.com>:

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_richcomparebool#c.PyObject_RichCompareBool)
 and understood it is intended, but there should be gentle comment to tell 
users this behaviour.

----------
components: C API
messages: 371927
nosy: tamuhey
priority: normal
severity: normal
status: open
title: PyObject_RichCompareBool(nan, nan, eq) can be True
type: enhancement
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41049>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to