Closed
Description
Most numpy modify-in-place functions give an error if write=False.
This doesn't happen for np.putmask
a = np.arange(12); a.setflags(write = False)
np.putmask(a, a >= 2, 5) # Success (Unexpected)
# The expected behaviour is
np.put(a, [3,4],5) # Error "ndarray.put should respect the writeable flag"
This is similar to a previous issue (ndarray.put should respect the writeable flag)
#5132
Surprisingly, putmask calls np.copy, which gives the expected error.
-- Andy