summaryrefslogtreecommitdiff
path: root/doc/release
diff options
context:
space:
mode:
authorNimish Telang <nimish@users.noreply.github.com>2017-06-29 15:14:03 +0100
committerNimish Telang <nimish@okcupid.com>2019-01-17 20:05:04 -0500
commit8fe81c1a69feeeee2769fee80646bae43a94d48d (patch)
treed8dbb2daf73bf2587ee39ec6491e030ffc26534b /doc/release
parent8f547f246b0c7463768adebafe0a57df9c03321b (diff)
downloadnumpy-8fe81c1a69feeeee2769fee80646bae43a94d48d.tar.gz
Make errstate a ContextDecorator
Diffstat (limited to 'doc/release')
-rw-r--r--doc/release/1.17.0-notes.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst
index c79c966c7..73de0b148 100644
--- a/doc/release/1.17.0-notes.rst
+++ b/doc/release/1.17.0-notes.rst
@@ -81,6 +81,27 @@ new function, ``np.ctypeslib.as_ctypes`` now supports a much wider range of
array types, including structures, booleans, and integers of non-native
endianness.
+`numpy.errstate` is now also function decorator
+-----------------------------------------------
+
+Currently, if you have a function like::
+
+ def foo():
+ pass
+
+and you want to wrap the whole thing in `errstate`, you have to rewrite it like so::
+
+ def foo():
+ with np.errstate(...):
+ pass
+
+but with this change, you can do::
+
+ @np.errstate(...)
+ def foo():
+ pass
+
+thereby saving a level of indentation
Changes
=======