
Feb. 28, 2022
7:35 p.m.
On Wed, Feb 23, 2022 at 4:21 PM Antonio Cuni <anto.cuni@gmail.com> wrote:
When refcheck=True (the default), numpy raises an error if you try to resize an array inplace whose refcnt > 2 (although I don't understand why > 2 and not > 1, and the docs aren't very clear about this).
That said, relying on the exact value of the refcnt is very bad for alternative implementations and for HPy, and in particular it is impossible to implement ndarray.resize(refcheck=True) correctly on PyPy. So from this point of view, a wording which explicitly restricts the "legal" usage of the refcnt details would be very welcome.
Thanks for the feedback and example. It helps. -eric