-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
MAINT: Misc np.array_api
annotation fixes
#19969
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
Conversation
_T = TypeVar("_T") | ||
NestedSequence = Sequence[Sequence[_T]] |
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.
NestedSequence
needs a free (subscriptable) parameter based on how it's used in np.array_api.asarray
:
NestedSequence[bool | int | float], |
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.
Off topic: mypy has some basic support for recursive types these days,
so it is now possible to define a proper arbitrary-nested sequence type with the help of protocols (xref #19894)
np.array_api
annotation fixes
These issues should also be mentioned at data-apis/array-api#143 |
Changed as `Array` does not live in the main `np.array_api` namespace
I feel that the points that had to be addressed have now been addressed (including updates to the spec where needed). |
This looks good to me. |
Well, if Aaron thinks this is good, lets get it in. Thanks Bas! |
Ping @asmeurer.
This PR introduces a number of minor annotation-related fixes to
np.array_api
.The individual comments go into more detail regarding the nature of the various fixes.