-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
ENH: Add typing for np.random and Generator #17103
Comments
Does the situation change on HEAD? |
edit: Remove linalg issues that seem to be spurious. Random is about the same.
|
#17104 should more or less fix the issue by adding placeholder stub files for all (untyped) sub-modules. More generally speaking, there is a large list of to-be typed objects, (see #16546) and this is simply going to take quite a bit time. |
#17104 has been merged now; all (public) objects in While still very broad, this will silence all "Module has no attribute ..." errors. |
I am not sure whether adding these I just feel contradictory about this. |
Considering the typing of numpy is very much a work in progress, I don't see any problem with this: Improvements are of course possible and, in fact, would be very much welcome additions. |
I agree that this is the pragmatic approach that allows for improvement when people who rely on these modules have time to invest. |
NumPy supplies partial typing support. Currently random's methods and Generator do not have typing information which results in errors in mypy.
Reproducing code example:
Use
mypy
on any project that usesnp.random
and you will see output likeNumpy/Python version information:
1.19.1 3.7.7 (default, May 7 2020, 21:25:33)
[GCC 7.3.0]
The text was updated successfully, but these errors were encountered: