Title: PEP 696: Support earlier type param as default value · Issue #20190 · python/mypy · GitHub
Open Graph Title: PEP 696: Support earlier type param as default value · Issue #20190 · python/mypy
X Title: PEP 696: Support earlier type param as default value · Issue #20190 · python/mypy
Description: Bug Report To Reproduce type A[S, T=S] = dict[S, T] a: A[int] = {} reveal_type(a) Expected Behavior note: Revealed type is "builtins.dict[builtins.int, builtins.int]" Actual Behavior error: Name "T" is not defined [name-defined] note: Re...
Open Graph Description: Bug Report To Reproduce type A[S, T=S] = dict[S, T] a: A[int] = {} reveal_type(a) Expected Behavior note: Revealed type is "builtins.dict[builtins.int, builtins.int]" Actual Behavior error: Name "T...
X Description: Bug Report To Reproduce type A[S, T=S] = dict[S, T] a: A[int] = {} reveal_type(a) Expected Behavior note: Revealed type is "builtins.dict[builtins.int, builtins.int]" Actual Behavior erro...
Opengraph URL: https://github.com/python/mypy/issues/20190
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PEP 696: Support earlier type param as default value","articleBody":"**Bug Report**\n\n**To Reproduce**\n\n```python\ntype A[S, T=S] = dict[S, T]\n\na: A[int] = {}\nreveal_type(a)\n```\n\n**Expected Behavior**\n\n```\nnote: Revealed type is \"builtins.dict[builtins.int, builtins.int]\"\n```\n\n**Actual Behavior**\n\n```\nerror: Name \"T\" is not defined [name-defined]\nnote: Revealed type is \"builtins.dict[builtins.int, Any]\"\n```\n\n**Your Environment**\n\n- Mypy version used: mypy 1.18.2 (compiled: yes)\n- Mypy configuration options from `mypy.ini` (and other config files):\n```\n[tool.mypy]\npython_version = \"3.13\"\nshow_error_codes = true\n```\n- Python version used: 3.13\n\n\nI can't repro in the playground, instead it says:\n```\nerror: Invalid syntax. Maybe you meant '==' or ':=' instead of '='?; you likely need to run mypy using Python 3.13 or newer [syntax]\n```","author":{"url":"https://github.com/hoodmane","@type":"Person","name":"hoodmane"},"datePublished":"2025-11-05T23:51:59Z","url":"https://github.com/python/mypy/issues/20190"}
| 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:43c95994-6085-d89a-72f7-9cc5fe56639b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A9F2:CF959:3855702:4AB4F32:6B0046F2 |
| html-safe-nonce | b3aef823896dd7433357703a4742912c9a5451e2b0921d9840e01c3ca21796f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUYyOkNGOTU5OjM4NTU3MDI6NEFCNEYzMjo2QjAwNDZGMiIsInZpc2l0b3JfaWQiOiI1ODkxNTgzNDc4NDA2ODU4NDgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6989f59b35e4c7ccc1fa2d7f292eac99688f39157afe66efcc8d2125705d4a3f |
| hovercard-subject-tag | issue:3593250909 |
| 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/20190/issue_layout |
| twitter:image | https://opengraph.githubassets.com/864e81b0810f9cdd254394bd23f9d625787624bd71ec0e32b6e23a727ff69255/python/mypy/issues/20190 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/864e81b0810f9cdd254394bd23f9d625787624bd71ec0e32b6e23a727ff69255/python/mypy/issues/20190 |
| og:image:alt | Bug Report To Reproduce type A[S, T=S] = dict[S, T] a: A[int] = {} reveal_type(a) Expected Behavior note: Revealed type is "builtins.dict[builtins.int, builtins.int]" Actual Behavior error: Name "T... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hoodmane |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width