Hi everyone,

In the Python free-threading build, mutating properties of a NumPy array
can corrupt the interpreter state. To address this, we have already
deprecated setting the shape or strides of an array. As a next step, we
would like to also deprecate setting ndarray.dtype and calling
ndarray.resize. The tracking issue for this effort is:
https://github.com/numpy/numpy/issues/28800.

Safe alternatives exist for both operations. For example, instead of
setting the dtype directly, users can create a new view with
array.view(new_dtype).

Since deprecations can affect downstream packages, we would like to gather
feedback before proceeding:

* Are there any objections to deprecating these operations in NumPy 2.5? If
so, what are the concerns?
* Which packages currently rely on setting ndarray.dtype or calling
ndarray.resize?
* Should we provide a public API for these operations? (The proposed PR
currently includes a private API.)

Kind regards,
Pieter Eendebak
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]

Reply via email to