10000 MNT: ``np.set_string_function`` implementation should be removed · Issue #26576 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MNT: np.set_string_function implementation should be removed #26576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ngoldbaum opened this issue May 30, 2024 · 0 comments · Fixed by #26611
Closed

MNT: np.set_string_function implementation should be removed #26576

ngoldbaum opened this issue May 30, 2024 · 0 comments · Fixed by #26611

Comments

@ngoldbaum
Copy link
Member

@mtsokol removed set_string_function from the public API in #24376, but the code and underlying C implementation are still in the codebase. The python version is marked as deprecated but the equivalent C API isn't.

We should replace the usages in docstrings with printoptions and remove it from the codebase. This also includes the public C API function PyArray_SetStringFunction which we may need to just stub out but leave behind for API stability, unfortunately this was missed for 2.0. A github search finds no usages outside of numpy itself or re-exports of the numpy C API.

The main reason I'd like to do this is this API is implemented using global variables and is not thread-safe. There's no reason to update code to be thread safe if it's private and only needed for a deprecated function that is no longer public.

@ngoldbaum ngoldbaum changed the title MNT: np.set_string_function implementation was neverremoved MNT: np.set_string_function implementation should be removed May 30, 2024
@charris charris changed the title MNT: np.set_string_function implementation should be removed MNT: np.set_string_function implementation should be removed May 30, 2024
@mtsokol mtsokol self-assigned this Jun 3, 2024
@mtsokol mtsokol linked a pull request Jun 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0