diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2021-05-18 22:53:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-18 13:53:29 -0700 |
commit | 39110f34ebc5e445ebea59833e621e4404c38be4 (patch) | |
tree | 390cae493e01d462d6e863392a1da5a79f358c7a /doc | |
parent | df821062b1f2fa2b6d689cef5b89bf76ad9df4d0 (diff) | |
download | numpy-39110f34ebc5e445ebea59833e621e4404c38be4.tar.gz |
DEP: Deprecate 4 `ndarray.ctypes` methods (#19031)
* DEP: Deprecate 4 `ndarray.ctypes` methods
* `get_data`
* `get_shape`
* `get_strides`
* `get_as_parameter`
* TST: Add deprecation tests for 4 `ndarray.ctypes` methods
* DOC: Add a release note for the `ndarray.ctypes` method deprecation
* MAINT: Deprecate via `__getattr__` instead of `__getattribute__
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
* MAINT: Deprecate the methods via proper function definitions
Co-Authored-By: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
* DOC: Added a missing "the"
* DOC: typo fix: property -> properties
Co-Authored-By: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Eric Wieser <425260+eric-wieser@users.noreply.github.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/upcoming_changes/19031.deprecation.rst | 12 | ||||
-rw-r--r-- | doc/source/user/misc.rst | 11 |
2 files changed, 18 insertions, 5 deletions
diff --git a/doc/release/upcoming_changes/19031.deprecation.rst b/doc/release/upcoming_changes/19031.deprecation.rst new file mode 100644 index 000000000..de92e18df --- /dev/null +++ b/doc/release/upcoming_changes/19031.deprecation.rst @@ -0,0 +1,12 @@ +Four `ndarray.ctypes` methods have been deprecated +-------------------------------------------------- +Four methods of the `ndarray.ctypes` object have been deprecated, +as they are (undocumentated) implementation artifacts of their respective +properties. + +The methods in question are: + +* ``_ctypes.get_data`` (use ``_ctypes.data`` instead) +* ``_ctypes.get_shape`` (use ``_ctypes.shape`` instead) +* ``_ctypes.get_strides`` (use ``_ctypes.strides`` instead) +* ``_ctypes.get_as_parameter`` (use ``_ctypes._as_parameter_`` instead) diff --git a/doc/source/user/misc.rst b/doc/source/user/misc.rst index 031ce4efa..f0a7f5e4c 100644 --- a/doc/source/user/misc.rst +++ b/doc/source/user/misc.rst @@ -149,11 +149,12 @@ Only a survey of the choices. Little detail on how each works. - good numpy support: arrays have all these in their ctypes attribute: :: - a.ctypes.data a.ctypes.get_strides - a.ctypes.data_as a.ctypes.shape - a.ctypes.get_as_parameter a.ctypes.shape_as - a.ctypes.get_data a.ctypes.strides - a.ctypes.get_shape a.ctypes.strides_as + a.ctypes.data + a.ctypes.data_as + a.ctypes.shape + a.ctypes.shape_as + a.ctypes.strides + a.ctypes.strides_as - Minuses: |