Title: TypeForm incremental inconsistencies · Issue #21587 · python/mypy · GitHub
Open Graph Title: TypeForm incremental inconsistencies · Issue #21587 · python/mypy
X Title: TypeForm incremental inconsistencies · Issue #21587 · python/mypy
Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Open Graph Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
X Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Opengraph URL: https://github.com/python/mypy
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeForm incremental inconsistencies","articleBody":"**Bug Report**\n\nThe following example does not error when running mypy after deleting `.mypy_cache` or when running with `--no-incremental` but does error after editing `b.py`.\nIt seems to be caching `TypeForm` as `type`.\n\n**To Reproduce**\n\n1) Download the code either from the zip archive or code blocks.\n2) Run `mypy`. It outputs `Success: no issues found in 2 source files`\n3) Make a whitespace change to `b.py` (eg add a new line at the end)\n4) Run `mypy`. It outputs the following\n```\nsrc\\b.py:3: error: Argument 1 to \"test\" has incompatible type \"str\"; expected \"type[Never]\" [arg-type]\nFound 1 error in 1 file (checked 2 source files)\n```\n5) Deleting `.mypy_cache` and running `mypy` or running `mypy --no-incremental` outputs the same as 2.\n\n\n[mypy.zip](https://github.com/user-attachments/files/28592195/mypy.zip)\n\n```python\n# src/a.py\nfrom typing import TypeVar\nfrom typing_extensions import TypeForm\n\nT = TypeVar('T')\n\ndef test(arg: TypeForm[T]) -> None:\n raise NotImplementedError\n```\n\n```py\n# src/b.py\nfrom a import test\n\ntest(\"int\")\n```\n\n```ini\n\n; mypy.ini\n[mypy]\ndisallow_untyped_defs = True\ncheck_untyped_defs = True\nwarn_return_any = True\npython_version = 3.14\nexplicit_package_bases = True\nmypy_path = $MYPY_CONFIG_FILE_DIR/src\nfiles =\n src\nenable_incomplete_feature = TypeForm\n```\n\n**Expected Behavior**\n\nI expect the output from mypy to be consistent regardless of caching.\n\n**Your Environment**\n\n- Mypy version used: 2.1.0\n- Python version used: 3.14\n- typing-extensions: 4.15.0\n","author":{"url":"https://github.com/gentlegiantJGC","@type":"Person","name":"gentlegiantJGC"},"datePublished":"2026-06-04T10:55:30Z","url":"https://github.com/python/mypy/issues/21587"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:d17ac86d-6a76-4154-118f-fa881cecb72d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D7D4:2DB972:2EF5FBF:3E32D66:6B002875 |
| html-safe-nonce | 912b6bcdb5d34e20980d848c0171aebd13b11aafea6f66e5e6d59508611c1e3e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0Q0OjJEQjk3MjoyRUY1RkJGOjNFMzJENjY6NkIwMDI4NzUiLCJ2aXNpdG9yX2lkIjoiMjkzOTA0MDA5MjMxMzg4ODg4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3eb2c1715a8078397bc10fd7b904e04cdb76bf3472144b314133e50ba8ad211a |
| hovercard-subject-tag | repository:7053637 |
| 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/python/mypy/issues/21587 |
| twitter:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| og:image:alt | Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-cache |
| 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