Skip to content

MAINT: replace ob_type access with Py_TYPE in PyArray_CheckExact#30712

Merged
charris merged 1 commit intonumpy:maintenance/2.4.xfrom
charris:backport-30705
Jan 22, 2026
Merged

MAINT: replace ob_type access with Py_TYPE in PyArray_CheckExact#30712
charris merged 1 commit intonumpy:maintenance/2.4.xfrom
charris:backport-30705

Conversation

@charris
Copy link
Member

@charris charris commented Jan 22, 2026

Backport of #30705.

Directly accessing ob_type like this will not be possible in a future ABI where PyObject is opaque (#30704). Py_TYPE is in the stable ABI starting in Python 3.14 and has been available outside the stable ABI forever, so we can use that instead to avoid accessing CPython internal details.

@charris charris added this to the 2.4.2 release milestone Jan 22, 2026
@charris charris added 03 - Maintenance 08 - Backport Used to tag backport PRs 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) labels Jan 22, 2026
@charris charris merged commit 41dd751 into numpy:maintenance/2.4.x Jan 22, 2026
74 checks passed
@charris charris deleted the backport-30705 branch January 22, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

03 - Maintenance 08 - Backport Used to tag backport PRs 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants