Title: Regression with generic TypeVar inheritance · Issue #12633 · python/mypy · GitHub
Open Graph Title: Regression with generic TypeVar inheritance · Issue #12633 · python/mypy
X Title: Regression with generic TypeVar inheritance · Issue #12633 · python/mypy
Description: Bug Report Regression added with #12590. Currently also part of the v0.950 release branch. /CC: @JukkaL To Reproduce from dataclasses import dataclass from typing import Any, Callable, Generic, TypeVar T = TypeVar("T") @dataclass class P...
Open Graph Description: Bug Report Regression added with #12590. Currently also part of the v0.950 release branch. /CC: @JukkaL To Reproduce from dataclasses import dataclass from typing import Any, Callable, Generic, Typ...
X Description: Bug Report Regression added with #12590. Currently also part of the v0.950 release branch. /CC: @JukkaL To Reproduce from dataclasses import dataclass from typing import Any, Callable, Generic, Typ...
Opengraph URL: https://github.com/python/mypy/issues/12633
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression with generic TypeVar inheritance","articleBody":"**Bug Report**\r\nRegression added with #12590. Currently also part of the v0.950 release branch.\r\n/CC: @JukkaL\r\n\r\n**To Reproduce**\r\n\r\n```py\r\nfrom dataclasses import dataclass\r\nfrom typing import Any, Callable, Generic, TypeVar\r\n\r\n\r\nT = TypeVar(\"T\")\r\n\r\n@dataclass\r\nclass Parent(Generic[T]):\r\n f: Callable[[T], Any]\r\n\r\n@dataclass\r\nclass Child(Parent[T]): ...\r\n\r\n\r\nclass A: ...\r\ndef func(obj: A) -> bool: ...\r\n\r\nreveal_type(Child[A](func).f)\r\n```\r\n\r\n**Expected Behavior**\r\n\r\n```\r\ntest.py:18: note: Revealed type is \"def (test.A) -> Any\"\r\n```\r\n\r\n**Actual Behavior**\r\n\r\n```\r\ntest.py:18: note: Revealed type is \"def (T`1) -> Any\"\r\ntest.py:18: error: Argument 1 to \"Child\" has incompatible type \"Callable[[A], bool]\"; expected \"Callable[[T], Any]\"\r\n```\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: mypy 0.960+dev.50213b520b131fc1dd037dfcc1938beba1f4e177","author":{"url":"https://github.com/cdce8p","@type":"Person","name":"cdce8p"},"datePublished":"2022-04-20T22:07:52Z","url":"https://github.com/python/mypy/issues/12633"}
| 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:db786293-d5b8-8475-ff67-81066c849779 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5D2:12476C:1B37C5B:23D6F29:6B0026B7 |
| html-safe-nonce | 76c571226e6382d1efe82500b43a19f6363723254c5212a747cca65ba168a7c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUQyOjEyNDc2QzoxQjM3QzVCOjIzRDZGMjk6NkIwMDI2QjciLCJ2aXNpdG9yX2lkIjoiMTk4MTU5NzgyMjI1MTcwNjAzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 53757c1320b451ed5a356ffc703f232d8b2e7202b2c03adf76a649f4557f13bf |
| hovercard-subject-tag | issue:1210268318 |
| 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/12633/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bd439ea72dfd995ff0ecffcd0b95b232097873fa4938f2095e0e1db7f8c0fe4/python/mypy/issues/12633 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bd439ea72dfd995ff0ecffcd0b95b232097873fa4938f2095e0e1db7f8c0fe4/python/mypy/issues/12633 |
| og:image:alt | Bug Report Regression added with #12590. Currently also part of the v0.950 release branch. /CC: @JukkaL To Reproduce from dataclasses import dataclass from typing import Any, Callable, Generic, Typ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cdce8p |
| 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