Title: Module Aliases for PEP 561 not working · Issue #5331 · python/mypy · GitHub
Open Graph Title: Module Aliases for PEP 561 not working · Issue #5331 · python/mypy
X Title: Module Aliases for PEP 561 not working · Issue #5331 · python/mypy
Description: 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: import numpy as np def f(x: np.ndarray): reveal_type(x) outputs: test.py:4: error: ...
Open Graph Description: 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: import numpy as np def f(x: np.ndarray): re...
X Description: 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: import numpy as np def f(x: np.ndarray)...
Opengraph URL: https://github.com/python/mypy/issues/5331
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Module Aliases for PEP 561 not working","articleBody":"Using the mypy's master branch (219fbf890bfbeb03e8720083f4b5850f7fa81636) and pip installing https://github.com/numpy/numpy-stubs (a PEP 561 package), running `mypy` on the following code:\r\n\r\n```python\r\nimport numpy as np\r\n\r\ndef f(x: np.ndarray):\r\n reveal_type(x)\r\n```\r\n\r\noutputs:\r\n\r\n```\r\ntest.py:4: error: Revealed type is 'Any'\r\n```\r\n\r\nBut if I do:\r\n\r\n```python\r\nfrom numpy import ndarray\r\n\r\ndef f(x: ndarray):\r\n reveal_type(x)\r\n```\r\n\r\nthen I get the expected\r\n\r\n```\r\ntest.py:4: error: Revealed type is 'numpy.ndarray'\r\n```","author":{"url":"https://github.com/alanhdu","@type":"Person","name":"alanhdu"},"datePublished":"2018-07-07T23:24:49Z","url":"https://github.com/python/mypy/issues/5331"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8eaee06d-729b-3018-fe7a-8f9768caaa61 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 901E:2FBAD6:31FEA:42800:6B0017BD |
| html-safe-nonce | 7e5eab2567c38d7c58d4f3521c4fd14870ce039139e12fa2f37b2b37bef99109 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDFFOjJGQkFENjozMUZFQTo0MjgwMDo2QjAwMTdCRCIsInZpc2l0b3JfaWQiOiI0ODU2MzY2MDkzNzEyNzU4NzE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fa663e34b885ea48045064c80eec734d69508a87c74626d3dd1e5c14abd45c09 |
| hovercard-subject-tag | issue:339182710 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/5331/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b0e320707042002387124a0d778e6aaf30c3176cee0e1bf89f2d1831ce026130/python/mypy/issues/5331 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0e320707042002387124a0d778e6aaf30c3176cee0e1bf89f2d1831ce026130/python/mypy/issues/5331 |
| og:image:alt | 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: import numpy as np def f(x: np.ndarray): re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alanhdu |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width