diff options
author | Evgeni Burovski <evgeny.burovskiy@gmail.com> | 2018-01-16 13:51:55 +0300 |
---|---|---|
committer | Evgeni Burovski <evgeny.burovskiy@gmail.com> | 2018-01-16 13:51:55 +0300 |
commit | c14e68e0ff36b922328889a846fab4cb23e1a942 (patch) | |
tree | 671c1adb4d0000c08d213be80c9a8f0f9e10f6f1 /numpy/core/arrayprint.py | |
parent | 3c8ac112455ab9d1792101ac25b8fa1472fac28b (diff) | |
download | numpy-c14e68e0ff36b922328889a846fab4cb23e1a942.tar.gz |
MAINT: address review comments
Diffstat (limited to 'numpy/core/arrayprint.py')
-rw-r--r-- | numpy/core/arrayprint.py | 11 |
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) |