We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using the mypy's master branch (219fbf8) and pip installing https://github.com/numpy/numpy-stubs (a PEP 561 package), running mypy on the following code:
mypy
import numpy as np def f(x: np.ndarray): reveal_type(x)
outputs:
test.py:4: error: Revealed type is 'Any'
But if I do:
from numpy import ndarray def f(x: ndarray): reveal_type(x)
then I get the expected
test.py:4: error: Revealed type is 'numpy.ndarray'
The text was updated successfully, but these errors were encountered:
Note that this example works perfectly fine with mypy 0.610. I ran a git bisect and believe that d91efd4 introduced the current behavior.
mypy 0.610
Sorry, something went wrong.
Confirmed the bisect, and it is happening on master.
The issue is this part here: https://github.com/python/mypy/blob/master/mypy/semanal.py#L3081. It appears that adding the __getattr__ check is too earnest, it does not allow for re-binding that occurs on line 3098.
__getattr__
No branches or pull requests
Using the mypy's master branch (219fbf8) and pip installing https://github.com/numpy/numpy-stubs (a PEP 561 package), running
mypy
on the following code:outputs:
But if I do:
then I get the expected
The text was updated successfully, but these errors were encountered: