MAINT: soft-deprecate PyArray_malloc/realloc/free in favor of PyMem_Raw APIs - #32334
Merged
Merged
Conversation
ngoldbaum
force-pushed
the
soft-deprecate-py-array-malloc
branch
from
August 18, 2026 16:39
ff216f7 to
1785d72
Compare
Member
|
Thanks Nathan. |
Member
Author
|
Exactly 20 years later, thanks Chuck!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
Followup from #32331 (ping @mattip).
From what I can tell,
NPY_USE_PYMEMhas been unconditionally defined to be 1 since August 19, 2006 (almost exactly 20 years ago!!) and the#elsebranch for when it's not defined has been dead code since then. Seenumpy/numpy/core/include/numpy/ndarrayobject.h
Line 690 in b9ce939
Let's soft-deprecate these but leave behind the define and aliases in case anyone is using them. Leaving these behind forever is free but managing a deprecation cycle isn't free.
AI Disclosure
An AI model did a code review pass