summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r--numpy/core/arrayprint.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
index d6e3cfda3..369b3a913 100644
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -274,17 +274,16 @@ def get_printoptions():
@contextlib.contextmanager
-def printoptions(*args, **kwds):
+def printoptions(*args, **kwargs):
"""Context manager for setting print options.
- See `set_printoptions` for the full description of available options.
+ Set print options for the scope of the `with` block, and restore the old
+ options at the end. See `set_printoptions` for the full description of
+ available options.
Examples
--------
- `printoptions` sets print options temporarily, and restores them back
- at the end of the `with`-block:
-
>>> with np.printoptions(precision=2):
... print(np.array([2.0])) / 3
[0.67]
@@ -301,7 +300,7 @@ def printoptions(*args, **kwds):
"""
opts = np.get_printoptions()
try:
- np.set_printoptions(*args, **kwds)
+ np.set_printoptions(*args, **kwargs)
yield np.get_printoptions()
finally:
np.set_printoptions(**opts)