Title: Reexported imports not tracked properly in fine-grained incremental mode · Issue #4512 · python/mypy · GitHub
Open Graph Title: Reexported imports not tracked properly in fine-grained incremental mode · Issue #4512 · python/mypy
X Title: Reexported imports not tracked properly in fine-grained incremental mode · Issue #4512 · python/mypy
Description: We fail to propagate changes when the target of an import changes. Here, we swap what module a imports foo from, but m.f doesn't get rechecked. [case testImportSwap] from a import foo def f() -> int: return foo() [file a.py] from b1 impo...
Open Graph Description: We fail to propagate changes when the target of an import changes. Here, we swap what module a imports foo from, but m.f doesn't get rechecked. [case testImportSwap] from a import foo def f() -> in...
X Description: We fail to propagate changes when the target of an import changes. Here, we swap what module a imports foo from, but m.f doesn't get rechecked. [case testImportSwap] from a import foo def f() -...
Opengraph URL: https://github.com/python/mypy/issues/4512
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reexported imports not tracked properly in fine-grained incremental mode","articleBody":"We fail to propagate changes when the target of an import changes.\r\n\r\nHere, we swap what module `a` imports `foo` from, but `m.f` doesn't get rechecked.\r\n```\r\n[case testImportSwap]\r\nfrom a import foo\r\ndef f() -> int:\r\n return foo()\r\n\r\n[file a.py]\r\nfrom b1 import foo\r\n[file a.py.2]\r\nfrom b2 import foo\r\n\r\n[file b1.py]\r\ndef foo() -> int:\r\n return 12\r\n[file b2.py]\r\ndef foo() -> str:\r\n return 'uhoh'\r\n[out]\r\n==\r\nmain:3: error: Incompatible return value type (got \"str\", expected \"int\")\r\n```\r\n\r\nSame thing if we switch from `a` importing `foo` to just defining it.\r\n```\r\n[case testImportSwap2]\r\nfrom b import foo\r\ndef f() -> int:\r\n return foo()\r\n\r\n[file a.py]\r\nfrom b import foo\r\n[file a.py.2]\r\ndef foo() -> str:\r\n return 'uhoh'\r\n\r\n[file b.py]\r\ndef foo() -> int:\r\n return 12\r\n[out]\r\n==\r\nmain:3: error: Incompatible return value type (got \"str\", expected \"int\")\r\n```\r\n\r\nSame problem without using `from` in `m`.\r\n```\r\n[case testImportSwap3]\r\nimport a\r\ndef f() -> int:\r\n return a.foo()\r\n[file a.py]\r\nfrom b1 import foo\r\n[file a.py.2]\r\nfrom b2 import foo\r\n\r\n[file b1.py]\r\ndef foo() -> int:\r\n return 12\r\n[file b2.py]\r\ndef foo() -> str:\r\n return 'uhoh'\r\n[out]\r\n==\r\nmain:3: error: Incompatible return value type (got \"str\", expected \"int\")\r\n```","author":{"url":"https://github.com/msullivan","@type":"Person","name":"msullivan"},"datePublished":"2018-01-25T22:51:45Z","url":"https://github.com/python/mypy/issues/4512"}
| 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:9ffc07cc-531d-ce29-cf4d-dab657a195f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB90:1C605E:ECDF7:149795:6B00632C |
| html-safe-nonce | 6eb028d009887fce4e6a0aebdec20af3066b68fe30f5a7affbed546e4d71e406 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjkwOjFDNjA1RTpFQ0RGNzoxNDk3OTU6NkIwMDYzMkMiLCJ2aXNpdG9yX2lkIjoiODQwNTIyMjkwNjY4NjEwNDM2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ed368940ca3b08e421f8b41dfd8a6756c7197f31b40f6a75f94bc4704993865d |
| hovercard-subject-tag | issue:291743854 |
| 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/4512/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e38ea8cd519a5b1f7f5045f4ef2bff7ee4c70edb8c396bced4dcaedac2b3942e/python/mypy/issues/4512 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e38ea8cd519a5b1f7f5045f4ef2bff7ee4c70edb8c396bced4dcaedac2b3942e/python/mypy/issues/4512 |
| og:image:alt | We fail to propagate changes when the target of an import changes. Here, we swap what module a imports foo from, but m.f doesn't get rechecked. [case testImportSwap] from a import foo def f() -> in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | msullivan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 25854482a1773a7c1ebb8be3d2bc1c6e61d82d78126be63b5044474a86d44d9e |
| 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 | e4f5c239e31f1f680e6bbc419ff92d774da616ec |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width