Title: Order-dependent "Cannot determine type" of module global str · Issue #5024 · python/mypy · GitHub
Open Graph Title: Order-dependent "Cannot determine type" of module global str · Issue #5024 · python/mypy
X Title: Order-dependent "Cannot determine type" of module global str · Issue #5024 · python/mypy
Description: This is a rather weird bug that showed up for us in production when I tried to upgrade to 0.600. The repro requires at least four files, so I decided to put it in its own little repo: https://github.com/JelleZijlstra/tmp-mypy-bug. Runnin...
Open Graph Description: This is a rather weird bug that showed up for us in production when I tried to upgrade to 0.600. The repro requires at least four files, so I decided to put it in its own little repo: https://githu...
X Description: This is a rather weird bug that showed up for us in production when I tried to upgrade to 0.600. The repro requires at least four files, so I decided to put it in its own little repo: https://githu...
Opengraph URL: https://github.com/python/mypy/issues/5024
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Order-dependent \"Cannot determine type\" of module global str","articleBody":"This is a rather weird bug that showed up for us in production when I tried to upgrade to 0.600. The repro requires at least four files, so I decided to put it in its own little repo: https://github.com/JelleZijlstra/tmp-mypy-bug. Running `mypy baddir` (with mypy 0.600) reproes the bug there.\r\n\r\nBasically, the test case has four files that import each other (`__init__` -> `ba` -> `b` -> `c`). `ba` additionally uses a name from `b` (defines as `LOCAL_HOSTNAME = socket.gethostname()`), and the usage of this name causes a \"Cannot determine type\" error. Various minor transformations (making `LOCAL_HOSTNAME` a string literal; removing `c.py`) make the error go away.\r\n\r\nInterestingly, renaming `ba.py` to `a.py` (as in the `gooddir` in the repo) silences the bug. This suggests that this is somehow related to the alphabetical order of the files involved. The bug didn't appear in 0.590. I'm guessing it's somehow related to the various FileSystemCache changes that went into 0.600. https://github.com/python/mypy/blob/master/mypy/find_sources.py#L78 is suspicious in that it does a sort and was new in 0.600, although really I'm just guessing.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2018-05-13T03:10:36Z","url":"https://github.com/python/mypy/issues/5024"}
| 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:c291802c-e028-b8dc-cb73-4058a7c19952 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C430:1DCF61:585D5:7A0F9:6B004E42 |
| html-safe-nonce | a4b643e71a424b85525e5d856bf97c260874a039f4963f1a03fcc28eb91d6746 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDMwOjFEQ0Y2MTo1ODVENTo3QTBGOTo2QjAwNEU0MiIsInZpc2l0b3JfaWQiOiIxMjg3ODE2NjgzODg4NTk0NDk4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cee703d56bd1fd30ae4fe6bd871d4ed8c92ffcae007cd8f345193fc30c790d18 |
| hovercard-subject-tag | issue:322559949 |
| 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/5024/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24b39742f33ec130b8282da7a14b7deba79010328cc223ba7772a3a5713249f0/python/mypy/issues/5024 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24b39742f33ec130b8282da7a14b7deba79010328cc223ba7772a3a5713249f0/python/mypy/issues/5024 |
| og:image:alt | This is a rather weird bug that showed up for us in production when I tried to upgrade to 0.600. The repro requires at least four files, so I decided to put it in its own little repo: https://githu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width