8000 DEP: Deprecate setting the dtype of an exact numpy.ndarray by eendebakpt · Pull Request #29244 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DEP: Deprecate setting the dtype of an exact numpy.ndarray #29244

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add release note
  • Loading branch information
eendebakpt committed Jun 24, 2025
commit e419b84ad7e505f6a3b77ecda32c9cdae4110282
9 changes: 9 additions & 0 deletions doc/release/upcoming_changes/29244.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Setting the ``dtype`` attribute is deprecated
---------------------------------------------
Setting the strides attribute is now deprecated since mutating
an array is unsafe if an array is shared, especially by multiple
threads. As an alternative, you can create a new view (no copy) via:
* `np.lib.stride_tricks.strided_window_view` if applicable,
* `np.lib.stride_tricks.as_strided` for the general case,
* or the `np.ndarray` constructor (``buffer`` is the original array) for a light-weight version.

0