numpy.setbufsize currently accepts negative values for size, but does nothing silently.
import numpy as np
print("Default bufsize:", np.getbufsize()) # 8192
with np.errstate():
prev = np.setbufsize(-1024) # negative size, meaningless
print("Previous bufsize:", prev) # 8192
print("Current bufsize:", np.getbufsize()) # still 8192, unchanged
# automatically restored
print("Restored bufsize:", np.getbufsize()) # 8192
I know that negative buffer sizes have no real meaning. Should this be treated the same as other invalid sizes (e.g., very small values), and raise an error instead of silently doing nothing?