Title: Possible regression in mypy 0.981: Generics don't work when TypeVar are previously used in a TypedDict · Issue #13755 · python/mypy · GitHub
Open Graph Title: Possible regression in mypy 0.981: Generics don't work when TypeVar are previously used in a TypedDict · Issue #13755 · python/mypy
X Title: Possible regression in mypy 0.981: Generics don't work when TypeVar are previously used in a TypedDict · Issue #13755 · python/mypy
Description: Bug Report When pulling the example of Generics from the documentation and specifying a generic TypedDict following the blog post, I get an error on simple Generic example. To Reproduce from typing import Generic, TypeVar from typing_ext...
Open Graph Description: Bug Report When pulling the example of Generics from the documentation and specifying a generic TypedDict following the blog post, I get an error on simple Generic example. To Reproduce from typing...
X Description: Bug Report When pulling the example of Generics from the documentation and specifying a generic TypedDict following the blog post, I get an error on simple Generic example. To Reproduce from typing...
Opengraph URL: https://github.com/python/mypy/issues/13755
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible regression in mypy 0.981: Generics don't work when TypeVar are previously used in a TypedDict","articleBody":"**Bug Report**\r\n\r\nWhen pulling the example of Generics from the [documentation](https://mypy.readthedocs.io/en/stable/generics.html) and specifying a generic TypedDict following the [blog post](https://mypy-lang.blogspot.com/2022/09/mypy-0981-released.html), I get an error on simple Generic example.\r\n\r\n**To Reproduce**\r\n```python\r\nfrom typing import Generic, TypeVar\r\nfrom typing_extensions import TypedDict # I am using python 3.10.4\r\n\r\nT = TypeVar(\"T\")\r\nMyDict = TypedDict(\"MyDict\", {\"foo\": T})\r\n\r\nclass Stack(Generic[T]): # mypy error: Free type variable expected in Generic[...] [misc]\r\n def __init__(self) -> None:\r\n pass\r\n```\r\nCommenting line 5 removes the error. Moving line 5 after the declaration of `Stack` also works.\r\n\r\n**Expected Behavior**\r\nThat class Stack is a correct Generic and mypy should not error.\r\n\r\n**Your Environment**\r\n- Mypy version used: 0.981\r\n- Python version used: 3.10.4","author":{"url":"https://github.com/jzazo","@type":"Person","name":"jzazo"},"datePublished":"2022-09-28T16:11:36Z","url":"https://github.com/python/mypy/issues/13755"}
| 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:dff2c6a6-b263-51f7-c388-c99e19020b04 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EDA:73851:BD8C2A:10565AF:6B003863 |
| html-safe-nonce | 7dfe11c6a40ad1523ec1adb9e3107d36e421d6efdc601acb04191daff03ad87a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RURBOjczODUxOkJEOEMyQToxMDU2NUFGOjZCMDAzODYzIiwidmlzaXRvcl9pZCI6Ijg3NDkzODYyNTg2NTgyNDM1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4e583e127ff8c5fca2226b057500ffca1f1b6590d030cb34ed9047ff1cb4cdcc |
| hovercard-subject-tag | issue:1389619953 |
| 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/13755/issue_layout |
| twitter:image | https://opengraph.githubassets.com/386d1a8255a9f41c30f59ea59e3f530c74bd90df3c95dc7798a7400de57e963d/python/mypy/issues/13755 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/386d1a8255a9f41c30f59ea59e3f530c74bd90df3c95dc7798a7400de57e963d/python/mypy/issues/13755 |
| og:image:alt | Bug Report When pulling the example of Generics from the documentation and specifying a generic TypedDict following the blog post, I get an error on simple Generic example. To Reproduce from typing... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jzazo |
| 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