Title: globl "type: ignore" ignores too much · Issue #13435 · python/mypy · GitHub
Open Graph Title: globl "type: ignore" ignores too much · Issue #13435 · python/mypy
X Title: globl "type: ignore" ignores too much · Issue #13435 · python/mypy
Description: Structure: sample_proj/__init__.py: from sample_proj.commons import some_const from sample_proj.some_file import SomeClass sample_proj/comons.py: some_const = 'qwe' sample_proj/some_file.py: # type: ignore from sample_proj.commons import...
Open Graph Description: Structure: sample_proj/__init__.py: from sample_proj.commons import some_const from sample_proj.some_file import SomeClass sample_proj/comons.py: some_const = 'qwe' sample_proj/some_file.py: # type...
X Description: Structure: sample_proj/__init__.py: from sample_proj.commons import some_const from sample_proj.some_file import SomeClass sample_proj/comons.py: some_const = 'qwe' sample_proj/some_file.py...
Opengraph URL: https://github.com/python/mypy/issues/13435
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"globl \"type: ignore\" ignores too much","articleBody":"Structure:\r\n\r\n`sample_proj/__init__.py`:\r\n```python\r\nfrom sample_proj.commons import some_const\r\nfrom sample_proj.some_file import SomeClass\r\n```\r\n\r\n`sample_proj/comons.py`:\r\n```python\r\nsome_const = 'qwe'\r\n```\r\n\r\n`sample_proj/some_file.py`:\r\n```python\r\n# type: ignore\r\n\r\nfrom sample_proj.commons import some_const\r\n\r\n\r\nclass SomeClass:\r\n def fun(self, param=some_const):\r\n pass\r\n```\r\n\r\n```\r\n$ mypy sample_proj\r\nsample_proj/__init__.py:2: error: Module \"sample_proj.some_file\" has no attribute \"SomeClass\"\r\nFound 1 error in 1 file (checked 3 source files)\r\n```\r\n\r\n I think it's a bug.\r\n\r\nRemoving `# type: ignore[union-attr]` helps. I wanted this comment to ignore only this exact error in the whole file.\r\n\r\n```\r\n$ mypy --version\r\nmypy 0.942\r\n$ python3 --version\r\nPython 3.10.5\r\n\r\n```","author":{"url":"https://github.com/socketpair","@type":"Person","name":"socketpair"},"datePublished":"2022-08-16T15:08:48Z","url":"https://github.com/python/mypy/issues/13435"}
| 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:4aa777da-1b50-717a-93a1-55d370963df6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81EE:21C1C3:14E8B4:1D297E:6B00826B |
| html-safe-nonce | 72f6623956a8436973bc7f153fe69275af82c312ba717ae308800dc8c0974fe2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUVFOjIxQzFDMzoxNEU4QjQ6MUQyOTdFOjZCMDA4MjZCIiwidmlzaXRvcl9pZCI6IjIwOTY1Njg3MzY2NDY0NjQxMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b9c7d87aa6901756ca087e407ae66306d9a96f244261936720951c7a9e261a69 |
| hovercard-subject-tag | issue:1340502067 |
| 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/13435/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6408f5975270dddf73d7d1f3ae7e2463e51f6395afb9d26073f1d4c2cd0c1b15/python/mypy/issues/13435 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6408f5975270dddf73d7d1f3ae7e2463e51f6395afb9d26073f1d4c2cd0c1b15/python/mypy/issues/13435 |
| og:image:alt | Structure: sample_proj/__init__.py: from sample_proj.commons import some_const from sample_proj.some_file import SomeClass sample_proj/comons.py: some_const = 'qwe' sample_proj/some_file.py: # type... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | socketpair |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83 |
| 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 | d1bc2aa1939001689f5ce935982c10a6138f745c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width