diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-05-12 09:27:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-12 09:27:12 -0700 |
commit | d2d589703d5ee743251fbc6ea045f28e1c5e9e71 (patch) | |
tree | df60e9574f8a2af7ad29cfbde2ad68b8a2ed405a /doc | |
parent | 798dce7d2f4d661eef2604bbd68fbe068c8d1ad6 (diff) | |
parent | 599dbade766ad3fecc82afa308803a2e0082c149 (diff) | |
download | numpy-d2d589703d5ee743251fbc6ea045f28e1c5e9e71.tar.gz |
Merge pull request #10308 from eric-wieser/mask-attr-is-view
API: Make MaskedArray.mask return a view, rather than the underlying mask
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.17.0-notes.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst index dcadc009b..4f9134e0b 100644 --- a/doc/release/1.17.0-notes.rst +++ b/doc/release/1.17.0-notes.rst @@ -66,6 +66,16 @@ zero:: >>> np.zeros(10)//1 array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) +``MaskedArray.mask`` now returns a view of the mask, not the mask itself +------------------------------------------------------------------------ +Returning the mask itself was unsafe, as it could be reshaped in place which +would violate expectations of the masked array code. It's behavior is now +consistent with the ``.data`` attribute, which also returns a view. + +The underlying mask can still be accessed with ``._mask`` if it is needed. +Tests that contain ``assert x.mask is not y.mask`` or similar will need to be +updated. + Do not lookup ``__buffer__`` attribute in `numpy.frombuffer` ------------------------------------------------------------ Looking up ``__buffer__`` attribute in `numpy.frombuffer` was undocumented and |