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
Closed
@ngoldbaum

Description

@ngoldbaum

@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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0