Hi all,

I am wondering if the larger community has opinions on deprecating
`arr.resize`:

    https://github.com/numpy/numpy/pull/30181

As a background, generally modifying things like the shape, data,
dtype, strides (i.e. container properties) is very unsafe.
That is because if that array is used anywhere else (that could be a
different thread or just an object that wraps it) than that code may
use unexpected values (up to crashes with threading).

Because of that we were slowly pushing on this recently.

Resize is particularly bad as it replaces data, but it also has a
`refcheck=True` (on CPython) that prevents (all?) bad usage unless set
to False.

I am a bit unsure that downstream patterns using it can really replace
it trivially (e.g. with concatenating chunks), and because of that I
would actually be happy with keeping this around as a "well, you better
know what you are doing because this is unsafe" function.

Cheers,

Sebastian
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]

Reply via email to