-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
DEP: Deprecate ndarray.resize #30181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
jorenham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got nothing to complain 👌
mhvk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, makes sense!
Co-authored-by: Joren Hammudoglu <[email protected]>
|
Will we make type-hint only deprecations a pattern now? FWIW, it seems nice it seems like a nice way to potentially get some feedback about impact (and I guess some libraries may clean it up before there even is a warning, which is a small bonus too)! I do have a slight worry with this one that while it won't be much code that is affected, it may not always be obvious how to replace The least obvious extreme case might be that the resize actually does make sense and one might have to use |
|
Internally, we seem to use it mostly in places where we're reading from a file, and the array should be extended. I think this would often involve a copy (not sure how likely it is memory right after an array allocated earlier is still available). In any python code at least, this is fairly trivially done with |
Addresses part of #28800
We deprecate
ndarray.resizein the type hints. In a followup PR (probably for a next numpy release) we will issue a deprecating working whenndarray.resizeis called.