[Numpy-discussion] copy="never" discussion and no deprecation cycle?

Stephan Hoyer shoyer at gmail.com
Wed Jun 16 17:59:40 EDT 2021


On Wed, Jun 16, 2021 at 1:01 PM Sebastian Berg <sebastian at sipsolutions.net>
wrote:

> 2. We introduce `copy="never"`, `copy="if_needed"` and `copy="always"`
>    as strings (all other strings will be a `TypeError`):
>
>    * Problem: `copy="never"` currently means `copy=True` (the opposite)
>                Which means new code has to take care when it may run on
>                older NumPy versions.  And in theory could make old code
>                return the wrong thing.
>

To me, this seems like a big problem.

People try to use newer NumPy features on old versions of NumPy all the
time. This works out OK if they get error messages, but we shouldn't add
new features that silently do something else on old versions -- especially
for recent old versions.

In particular, both copy='if_needed' and copy='never' would mean
copy='always' on old versions of NumPy. This seems bad -- basically the
exact opposite of what the user explicitly requested. These sort of bugs
can be quite challenging to track down.

So in my opinion (1) and (3) are the only real options.


> 3. Same as 2. But we take it very slow: Make strings an error right now
>    and only introduce the new options after two releases as per typical
>    deprecation policy.
>
>
> ## Discussion
>
> We discussed it briefly today in the triage call and we were leaning
> towards strings.
>
> I was honestly expecting to converge to option 3 to avoid compatibility
> issues (mainly surprises with `copy="never"` on older versions).
> But considering how weird it is to currently pass `copy="never"`, the
> question was whether we should not change it with a release note.
>
> The probability of someone currently passing exactly one of those three
> (and no other) strings seems exceedingly small.
>
> Personally, I don't have a much of an opinion.  But if *nobody* voices
> any concern about just changing the meaning of the string inputs, I
> think the current default may be to just do it.
>
> Cheers,
>
> Sebastian
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20210616/c44bd3c7/attachment-0001.html>


More information about the NumPy-Discussion mailing list