Skip to content

Commit ee4b7ea

Browse files
committed
DOC: add setbufsize example errstate context manager
[skip actions][skip azp][skip cirrus]
1 parent fb98231 commit ee4b7ea

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

numpy/_core/_ufunc_config.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,16 @@ def setbufsize(size):
174174
175175
Examples
176176
--------
177-
>>> np.setbufsize(4096)
177+
When exiting a `numpy.errstate` context manager the bufsize is restored:
178+
179+
>>> with np.errstate():
180+
... np.setbufsize(4096)
181+
... print(np.getbufsize())
182+
...
178183
8192
179-
>>> np.getbufsize()
180184
4096
185+
>>> np.getbufsize()
186+
8192
181187
182188
"""
183189
old = _get_extobj_dict()["bufsize"]

0 commit comments

Comments
 (0)