TSK: deprecate setting strides
, dtype
, and shape
on arrays.
#28800
Labels
17 - Task
39 - free-threading
PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)
Milestone
As seen in #28727, mutating arrays like this is dangerous in surprising ways, particularly on the free-threaded build.
We should guide people towards safer alternatives that create new views or copies of arrays instead of mutating.
We should first try deprecating
strides
anddtype
, thenshape
, since we expect that settingshape
is used the most (beforenp.reshape
it was the only way to do it).To do the actual deprecation, first someone needs to add the warning and deal with any fallout in the NumPy tests. Make sure the deprecation warnings indicate clearly how to update affected code. It would also be good to look at some downstream libraries like SciPy, matplotlib, pandas, and scikit-learn to see how much noise these deprecations cause in downstream tests.
If it isn't too bad and the fixes are straightforward, we should be good to go.
The text was updated successfully, but these errors were encountered: