Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2021-10-13.21:30:01.697>created_at=<Date2021-10-11.23:51:20.093>labels= ['expert-C-API', '3.11']
title="[C API] Py_IS_INFINITY() macro doesn't work in the limited C API if isinf() is not defined"updated_at=<Date2021-10-15.17:45:37.921>user='https://github.com/vstinner'
Problem: Py_FORCE_DOUBLE() is excluded from the limited C API (and the stable ABI).
I see different options:
Implement Py_IS_INFINITY() as an opaque function if the HAVE_DECL_ISINF macro is not defined. I did something similar in Py_INCREF() to support the limited C API with a debug build of Python: call _Py_IncRef() opaque function.
Make Py_FORCE_DOUBLE() private and add it to the limited C API as an implementation detail.
Add Py_FORCE_DOUBLE() macro to the limited C API: the current implementation is fragile, it depends on how Python.h is included. Also, I dislike macros in the limited C API.
I would prefer to *remove* Py_FORCE_DOUBLE() to all APIs, than adding it to the limited C API.