Improved numpy typing. #984
AaronSartin
started this conversation in
Ideas
Replies: 1 comment
-
The suggestion is closely tied with #983. See this comment for an example of the typing I would like to see. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
ArrayLike
is a general union. It drops a lot of the type information. I appreciated the extra info included inAnnotated
but a more specific type likenpt.NDArray[np.float64]
is often preferred for at least the return types. Withno_convert
enabled it is important for input types as well. Unfortunately this isn't a type that's easy to override with atype_caster
because the type is generated instubgen.py
. I am running this sed command after generating my stubs to fix the typing:Is there a better solution already available? Would there be interest in updating
stubgen.py
to make this typing pattern the default behavior?Beta Was this translation helpful? Give feedback.
All reactions