Title: mypy should not follow imports from stubs with --follow-imports=skip · Issue #3727 · python/mypy · GitHub
Open Graph Title: mypy should not follow imports from stubs with --follow-imports=skip · Issue #3727 · python/mypy
X Title: mypy should not follow imports from stubs with --follow-imports=skip · Issue #3727 · python/mypy
Description: Currently, even with --follow-imports=skip imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked. Consider the following example: # main...
Open Graph Description: Currently, even with --follow-imports=skip imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked...
X Description: Currently, even with --follow-imports=skip imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked...
Opengraph URL: https://github.com/python/mypy/issues/3727
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy should not follow imports from stubs with --follow-imports=skip","articleBody":"Currently, even with `--follow-imports=skip` imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked.\r\n\r\nConsider the following example:\r\n```py\r\n# main.py\r\nfrom stub import x\r\n```\r\n\r\n```py\r\n# stub.pyi\r\nfrom unanalyzed import x\r\n```\r\n\r\n```py\r\n# unanalyzed.py\r\nx: int = 42\r\n\r\nx + '' # error is reported here but it shouldn't be because this file is unanalyzed\r\n```\r\n\r\nCurrently, if you run mypy the following happens:\r\n```\r\n$ mypy main.py --follow-imports=skip\r\nunanalyzed.py:4: error: Unsupported operand types for + (\"int\" and \"str\")\r\n```\r\n\r\nI think we should treat imports from stub and non-stub files the same way. Following imports from stubs in silent mode was implemented #1372.\r\n\r\nDiscovered this bug when investigating an error in Dropbox internal codebases.","author":{"url":"https://github.com/ilinum","@type":"Person","name":"ilinum"},"datePublished":"2017-07-17T21:00:44Z","url":"https://github.com/python/mypy/issues/3727"}
| 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:707d0133-e080-f74b-1243-11346bb30c48 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B054:D33AC:E48D59:131FAC3:6B00576D |
| html-safe-nonce | 7193ed06ada6a16b615cabe333da99ae555a3a2079394acab82221c7045d0cfb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDU0OkQzM0FDOkU0OEQ1OToxMzFGQUMzOjZCMDA1NzZEIiwidmlzaXRvcl9pZCI6IjEyMjY2NDkyMjg1Mzc3ODAwNzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ebb7890e1aebeeebae7bc282bd0d49325f85a844d6c776ae2aea5652b09e56a1 |
| hovercard-subject-tag | issue:243526199 |
| 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/3727/issue_layout |
| twitter:image | https://opengraph.githubassets.com/938af190e8fe51571eeeefe15db83f4c29d7be0349cacbf70fcaefebb5af3bfa/python/mypy/issues/3727 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/938af190e8fe51571eeeefe15db83f4c29d7be0349cacbf70fcaefebb5af3bfa/python/mypy/issues/3727 |
| og:image:alt | Currently, even with --follow-imports=skip imports from stub files are still followed. This means that if stub imports an unanalyzed module, the previously unanalyzed module is actually typechecked... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilinum |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width