8000 ENH: Add dtype-support to the `np.core.shape_base` annotations by BvB93 · Pull Request #19245 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Add dtype-support to the np.core.shape_base annotations #19245

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

Merged
merged 3 commits into from
Jun 17, 2021

Conversation

BvB93
Copy link
Member
@BvB93 BvB93 commented Jun 14, 2021

Not much to add beyond the title: this PR adds basic dtype typing support to the functions in np.core.shape_base.

Comment on lines +19 to +24
@overload
def atleast_1d(__arys: _ArrayLike[_SCT]) -> NDArray[_SCT]: ...
@overload
def atleast_1d(__arys: ArrayLike) -> NDArray[Any]: ...
@overload
def atleast_1d(*arys: ArrayLike) -> List[NDArray[Any]]: ...
Copy link
Member Author
@BvB93 BvB93 Jun 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left the dtype ambiguous for all cases where >1 array is passed.
Namely, getting this right is will be very difficult unless all arrays are of the same dtype,
especially since list itself is invariant.

@charris charris merged commit e0ceabc into numpy:main Jun 17, 2021
@charris
Copy link
Member
charris commented Jun 17, 2021

Thanks Bas.

@BvB93 BvB93 deleted the shape_base branch June 17, 2021 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0