Title: (🐞) Explicit type parameter specification with method reference screws up assignability · Issue #13041 · python/mypy · GitHub
Open Graph Title: (🐞) Explicit type parameter specification with method reference screws up assignability · Issue #13041 · python/mypy
X Title: (🐞) Explicit type parameter specification with method reference screws up assignability · Issue #13041 · python/mypy
Description: from typing import _T as T, Callable, Generic, TypeVar class A(Generic[T]): def f(self) -> None: ... c: Callable[[A[int]], None] c = A.f c = A[int].f # error: Incompatible types in assignment (expression has type "(A[T]) -> None", variab...
Open Graph Description: from typing import _T as T, Callable, Generic, TypeVar class A(Generic[T]): def f(self) -> None: ... c: Callable[[A[int]], None] c = A.f c = A[int].f # error: Incompatible types in assignment (expr...
X Description: from typing import _T as T, Callable, Generic, TypeVar class A(Generic[T]): def f(self) -> None: ... c: Callable[[A[int]], None] c = A.f c = A[int].f # error: Incompatible types in assignment (e...
Opengraph URL: https://github.com/python/mypy/issues/13041
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"(🐞) Explicit type parameter specification with method reference screws up assignability","articleBody":"```py\r\nfrom typing import _T as T, Callable, Generic, TypeVar\r\n\r\nclass A(Generic[T]):\r\n def f(self) -> None: ...\r\n\r\nc: Callable[[A[int]], None]\r\nc = A.f\r\nc = A[int].f # error: Incompatible types in assignment (expression has type \"(A[T]) -> None\", variable has type \"(A[int]) -> None\") \r\n```\r\n> expression has type \"(A[T]) -> None\"\r\n\r\nUhhhh, I don't think it does...\r\n\r\n# Mypy in Real Life\r\n```py\r\nclass B(A[int]): ...\r\n\r\n# some higher order method\r\nfoo(list_of_b, B.f) # error\r\n```","author":{"url":"https://github.com/KotlinIsland","@type":"Person","name":"KotlinIsland"},"datePublished":"2022-06-30T04:04:20Z","url":"https://github.com/python/mypy/issues/13041"}
| 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:1d787c36-b1fb-3008-b3c0-c058516bd458 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98D0:1833B7:1A476BA:2352C8E:6AFFFBA3 |
| html-safe-nonce | fc824d9855b205ef6881fd01fe62a78a1da168fb47920ef84b199f44c5d5aae7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEQwOjE4MzNCNzoxQTQ3NkJBOjIzNTJDOEU6NkFGRkZCQTMiLCJ2aXNpdG9yX2lkIjoiODEzMDg4MjIwMTM2NjU1OTY1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 797c70e8e14da79078c64c94cd90435803c7e2bf72b0aca8299123fb1e32bcb1 |
| hovercard-subject-tag | issue:1289550622 |
| 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/13041/issue_layout |
| twitter:image | https://opengraph.githubassets.com/044d90fcc3cc820127e99bdc03b30b2c300d8446aed3fcc931e2adc7cc77ec12/python/mypy/issues/13041 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/044d90fcc3cc820127e99bdc03b30b2c300d8446aed3fcc931e2adc7cc77ec12/python/mypy/issues/13041 |
| og:image:alt | from typing import _T as T, Callable, Generic, TypeVar class A(Generic[T]): def f(self) -> None: ... c: Callable[[A[int]], None] c = A.f c = A[int].f # error: Incompatible types in assignment (expr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KotlinIsland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width