Title: Bug involving Python 2, incremental mode, partial cache invalidation, and possibly nested folders · Issue #1967 · python/mypy · GitHub
Open Graph Title: Bug involving Python 2, incremental mode, partial cache invalidation, and possibly nested folders · Issue #1967 · python/mypy
X Title: Bug involving Python 2, incremental mode, partial cache invalidation, and possibly nested folders · Issue #1967 · python/mypy
Description: I recently ran into a bug that manifests when running Python 2 with incremental mode. Here is the shortest repro I was able to create so far: File structure parent/ __init__.py a.py b.py subfolder/ __init__.py child_a/ __init__.py c.py c...
Open Graph Description: I recently ran into a bug that manifests when running Python 2 with incremental mode. Here is the shortest repro I was able to create so far: File structure parent/ __init__.py a.py b.py subfolder/...
X Description: I recently ran into a bug that manifests when running Python 2 with incremental mode. Here is the shortest repro I was able to create so far: File structure parent/ __init__.py a.py b.py subfolder/...
Opengraph URL: https://github.com/python/mypy/issues/1967
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug involving Python 2, incremental mode, partial cache invalidation, and possibly nested folders","articleBody":"I recently ran into a bug that manifests when running Python 2 with incremental mode. Here is the shortest repro I was able to create so far:\n\n**File structure**\n\n```\nparent/\n __init__.py\n a.py\n b.py\n subfolder/\n __init__.py\n child_a/\n __init__.py\n c.py\n child_b/\n __init__.py\n d.py\ne.py\n```\n\n**parent/a.py**\n\n``` python\nimport e \na_const = 0\n```\n\n**parent/b.py**\n\n``` python\nb_const = 0\n```\n\n**parent/subfolder/child_a/**`__init__.py`\n\n``` python\nfrom .c import c_const\n```\n\n**parent/subfolder/child_a/c.py**\n\n``` python\nfrom parent.b import b_const\nc_const = 0\n```\n\n**parent/subfolder/child_b/d.py**\n\n``` python\nfrom parent.a import a_const\nfrom ..child_a import c\n```\n\n**e.py**\n\n``` python\nfrom types import FunctionType\n```\n\nAll of the other `__init__.py` files are empty.\n\nWhen you try running mypy in incremental mode with Python 2, you get a spurious error in the second run (note that I update the timestamp of `parent/b.py` to force mypy to recheck that file):\n\n```\n$ rm -rf .mypy_cache\n$ python3 -m mypy --py2 --incremental parent\n$ touch parent/b.py\n$ python3 -m mypy --py2 --incremental parent\nexperiments/parent/subfolder/child_b/d.py:2: error: Module has no attribute 'c'\n```\n\nHowever, mypy works as expected when running in Python 3 mode. I'm not entirely sure why that is.\n\nI'm planning on continuing to try and make a shorter/more enlightening repro, but I figured I should file an issue now to get this on the record.\n","author":{"url":"https://github.com/Michael0x2a","@type":"Person","name":"Michael0x2a"},"datePublished":"2016-07-31T05:18:56Z","url":"https://github.com/python/mypy/issues/1967"}
| 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:9891e36a-be4c-73fa-8ab1-b6a00a5c6217 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A18:3EE843:1EB098C:29C20DA:6B001B21 |
| html-safe-nonce | 34c15962271ccd3db656dd5e754e114d5b571ab3490ee16e020c5396f0b8b50b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTE4OjNFRTg0MzoxRUIwOThDOjI5QzIwREE6NkIwMDFCMjEiLCJ2aXNpdG9yX2lkIjoiMTA0OTE1NDM1Nzc5NjI4MTEyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 382e6778d46659274480dd42dfe96e4662c12f670dbd40da20a104e7802f5820 |
| hovercard-subject-tag | issue:168502237 |
| 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/1967/issue_layout |
| twitter:image | https://opengraph.githubassets.com/05c13bdc9ef53f51137439748cb971a11bb83ba7b520139c611f45efad102f6f/python/mypy/issues/1967 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/05c13bdc9ef53f51137439748cb971a11bb83ba7b520139c611f45efad102f6f/python/mypy/issues/1967 |
| og:image:alt | I recently ran into a bug that manifests when running Python 2 with incremental mode. Here is the shortest repro I was able to create so far: File structure parent/ __init__.py a.py b.py subfolder/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Michael0x2a |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width