diff options
author | Stephan Hoyer <shoyer@google.com> | 2019-01-14 09:52:36 +0200 |
---|---|---|
committer | Stephan Hoyer <shoyer@google.com> | 2019-01-14 09:52:36 +0200 |
commit | 8d9faa7968d2ff3a853744f17bcb824f0d1fb4df (patch) | |
tree | 85af19b8b76136bf8eb0f72b495b010a94e10da7 /doc/release | |
parent | 65202bf2d2df8f9bd1f27a7a3f274c42fd1bd927 (diff) | |
download | numpy-8d9faa7968d2ff3a853744f17bcb824f0d1fb4df.tar.gz |
DOC: clarify the extend of __array_function__ support in NumPy 1.16
I'm sorry I didn't get this in earlier! Hopefully this will make it clearer to
users ``__array_function__`` is only opt-in for now.
Diffstat (limited to 'doc/release')
-rw-r--r-- | doc/release/1.16.0-notes.rst | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/doc/release/1.16.0-notes.rst b/doc/release/1.16.0-notes.rst index de636933f..341d5f715 100644 --- a/doc/release/1.16.0-notes.rst +++ b/doc/release/1.16.0-notes.rst @@ -20,7 +20,7 @@ easier going forward. Highlights ========== -* Experimental support for overriding numpy functions, +* Experimental (opt-in only) support for overriding numpy functions, see ``__array_function__`` below. * The ``matmul`` function is now a ufunc. This provides better @@ -518,14 +518,16 @@ accessing invalid memory locations. NumPy functions now support overrides with ``__array_function__`` ----------------------------------------------------------------- -It is now possible to override the implementation of almost all NumPy functions -on non-NumPy arrays by defining a ``__array_function__`` method, as described -in `NEP 18`_. The sole exception are functions for explicitly casting to NumPy -arrays such as ``np.array``. As noted in the NEP, this feature remains -experimental and the details of how to implement such overrides may change in -the future. +NumPy has a new experimental mechanism for overriding the implementation of +almost all NumPy functions on non-NumPy arrays by defining an +``__array_function__`` method, as described in `NEP 18`_. + +This feature is not yet been enabled by default, but has been released to +facilitate experimentation by potential users. See the NEP for details on +setting the appropriate environment variable. We expect the NumPy 1.17 release +will enable overrides by default, which will also be more performant due to a +new implementation written in C. -.. _`NEP 15` : http://www.numpy.org/neps/nep-0015-merge-multiarray-umath.html .. _`NEP 18` : http://www.numpy.org/neps/nep-0018-array-function-protocol.html Arrays based off readonly buffers cannot be set ``writeable`` |