MAINT, TYP: Added missing where typehints in fromnumeric.pyi#20918
MAINT, TYP: Added missing where typehints in fromnumeric.pyi#20918BvB93 merged 4 commits intonumpy:mainfrom
Conversation
BvB93
left a comment
There was a problem hiding this comment.
Thanks, looks pretty good overall but I've got two general comments:
- The
wherearguments should be marked as keyword only (matching runtime behavior). - Besides the functions in
fromnumeric.pyithere are also the identically named methods in the main__init__.pyifile (e.g.ndarray.all). Could you change those as well?
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
@BvB93 If I understood correctly, your comments should have been addressed now. I note that there are a bunch of functions in fromnumeric.py, where the where argument is not keyword-only, e.g. numpy/numpy/core/fromnumeric.py Line 2163 in 8f8e14e Wrt. the kw only inconsistency, would you like me to open an issue, a PR or both, or do nothing? |
So the move towards the use of keyword-only arguments is somewhat recent, and with this in mind it is no coincidence that the (keyword-only) Changing all the (much older) remaining |
|
Thanks @janusheid |
I read that as do nothing. I agree that such a change would be backwards incompatible and that one can argue that it is not terribly important. Sometimes it can be helpful to have an issue that others can find if they have the same question, but in this case it it perhaps more of a general problem of kw only args throughout the api. |
|
Hi-five on merging your first pull request to NumPy, @janusheide! We hope you stick around! Your choices aren’t limited to programming – you can review pull requests, help us stay on top of new and old issues, develop educational material, work on our website, add or improve graphic design, create marketing materials, translate website content, write grant proposals, and help with other fundraising initiatives. For more info, check out: https://numpy.org/contribute |
Adding typehints for 'where' argument in a couple of functions in fromnumeric, where it appears to be missing.