diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2012-05-15 22:12:41 +0100 |
---|---|---|
committer | Nathaniel J. Smith <njs@pobox.com> | 2012-05-16 14:11:28 +0100 |
commit | bea52bf307782b2a211b7fcfa6696fad45dae275 (patch) | |
tree | 435834d34ff9dd7a12f5acc62b45cbf77d623453 /numpy/core/fromnumeric.py | |
parent | d403fed2423caec4149937fe48781ac68b21fddb (diff) | |
download | numpy-bea52bf307782b2a211b7fcfa6696fad45dae275.tar.gz |
Transition scheme for allowing PyArray_Diagonal to return a view
PyArray_Diagonal is changed to return a copy of the diagonal (as in
numpy 1.6 and earlier), but with a new (hidden) WARN_ON_WRITE flag
set. Writes to this array (or views thereof) will continue to work as
normal, but the first write will trigger a DeprecationWarning.
We also issue this warning if someone extracts a non-numpy writeable
view of the array (e.g., by accessing the Python-level .data
attribute). There are likely still places where the data buffer is
exposed that I've missed -- review welcome!
New known-fail test: eye() for maskna arrays was only implemented by
exploiting ndarray.diagonal's view-ness, so it is now unimplemented
again, and the corresponding test is marked known-fail.
Diffstat (limited to 'numpy/core/fromnumeric.py')
0 files changed, 0 insertions, 0 deletions