summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2019-01-22 14:07:47 -0800
committerStephan Hoyer <shoyer@google.com>2019-01-22 14:13:39 -0800
commit96d179ce5bd0e3f75508f6afdfb2fb65170cc83c (patch)
treeeda5cca68be758029c47c10252d7a59189935c3f /doc
parent3cbc11ac56054ad3ac7461e57433aefe37f2e3e4 (diff)
downloadnumpy-96d179ce5bd0e3f75508f6afdfb2fb65170cc83c.tar.gz
ENH: __array_function__ updates for NumPy 1.17.0
- Always enable __array_function__ overrides. - Remove special cases for Python 2 compatibility. - Document these changes in 1.17.0-notes.rst. It will be good to see ASV numbers to understand the performance implications of these changes. If need be, we can speed up NumPy functions internally by using non-dispatched functions (with ``.__wrapped__``).
Diffstat (limited to 'doc')
-rw-r--r--doc/release/1.17.0-notes.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst
index 4bdb812d7..51e195437 100644
--- a/doc/release/1.17.0-notes.rst
+++ b/doc/release/1.17.0-notes.rst
@@ -6,6 +6,9 @@ NumPy 1.17.0 Release Notes
Highlights
==========
+* Experimental support for overriding numpy functions is now always available,
+ see ``__array_function__`` below.
+
* NumPy's FFT implementation has switched to pocketfft
New functions
@@ -122,3 +125,12 @@ Changes
-------------------------------------------------------
The modulus operation with two ``np.timedelta64`` operands now returns
``NaT`` in the case of division by zero, rather than returning zero
+
+NumPy functions now always support overrides with ``__array_function__``
+------------------------------------------------------------------------
+NumPy now always checks the ``__array_function__`` method to implement overrides
+of NumPy functions on non-NumPy arrays, as described in `NEP 18`_. The feature
+was available for testing with NumPy 1.16 if appropriate environment variables
+are set, but is now always enabled.
+
+.. _`NEP 18` : http://www.numpy.org/neps/nep-0018-array-function-protocol.html