Skip to content

CLN: use isnan() instead of the Py_IS_NAN macro - #58850

Merged
WillAyd merged 1 commit into
pandas-dev:mainfrom
skirpichev:no-py-is-nan
May 30, 2024
Merged

WillAyd merged 1 commit into
pandas-dev:mainfrom
skirpichev:no-py-is-nan

Conversation

@skirpichev

Copy link
Copy Markdown
Contributor

Since 3.11 the later is just an alias for isnan(). See also python/cpython#119613

Since 3.11 the later is just an alias for isnan().  See also
python/cpython#119613
@WillAyd

WillAyd commented May 28, 2024 •

Copy link
Copy Markdown
Member

What about Python 3.10? Noted on the C99 requirement (we actually require a C11 compiler anyway) but are these macros equivalent still on 3.10 or is there a possibility of a behavior difference?

@skirpichev

Copy link
Copy Markdown
Contributor Author

There is. If you support platforms without IEEE 754, without NaN, and without C99+ <math.h>. Macroses were more complex to cover such cases, e.g.:
https://github.com/python/cpython/blob/c8f868dc52f98011d0f9b459b6487920bfb0ac4d/Include/pymath.h#L97-L103

@WillAyd

WillAyd commented May 28, 2024

Copy link
Copy Markdown
Member

OK thanks for that info. I think we are OK with this as is then. Appreciate the PR

@WillAyd WillAyd added the Clean label May 28, 2024
@WillAyd

WillAyd commented May 28, 2024

Copy link
Copy Markdown
Member

@mroeschke

@WillAyd
WillAyd merged commit a564662 into pandas-dev:main May 30, 2024
@WillAyd

WillAyd commented May 30, 2024

Copy link
Copy Markdown
Member

Thanks @skirpichev

@mroeschke mroeschke added this to the 3.0 milestone May 31, 2024
@skirpichev
skirpichev deleted the no-py-is-nan branch May 31, 2024 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants