Title: Generic inference regression from #5699 · Issue #5738 · python/mypy · GitHub
Open Graph Title: Generic inference regression from #5699 · Issue #5738 · python/mypy
X Title: Generic inference regression from #5699 · Issue #5738 · python/mypy
Description: Since #5699, mypy now rejects the following program (minimized from a few failures at dropbox): from typing import TypeVar, Callable, Tuple T = TypeVar('T') def f(x: Callable[..., T]) -> T: return x() x: Tuple[str, ...] = f(tuple) with t...
Open Graph Description: Since #5699, mypy now rejects the following program (minimized from a few failures at dropbox): from typing import TypeVar, Callable, Tuple T = TypeVar('T') def f(x: Callable[..., T]) -> T: return ...
X Description: Since #5699, mypy now rejects the following program (minimized from a few failures at dropbox): from typing import TypeVar, Callable, Tuple T = TypeVar('T') def f(x: Callable[..., T]) ->...
Opengraph URL: https://github.com/python/mypy/issues/5738
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generic inference regression from #5699","articleBody":"Since #5699, mypy now rejects the following program (minimized from a few failures at dropbox):\r\n```\r\nfrom typing import TypeVar, Callable, Tuple\r\n\r\nT = TypeVar('T')\r\n\r\ndef f(x: Callable[..., T]) -> T:\r\n return x()\r\n\r\nx: Tuple[str, ...] = f(tuple)\r\n```\r\nwith the error message\r\n`Incompatible types in assignment (expression has type \"Tuple[_T_co, ...]\", variable has type \"Tuple[str, ...]\")`\r\n\r\n@ilevkivskyi thoughts?\r\n\r\nTo be honest I'm not totally sure how we used to get this right, since my understanding was that we don't do the sort of instantiation of all type variables and unification that I would expect to be necessary?","author":{"url":"https://github.com/msullivan","@type":"Person","name":"msullivan"},"datePublished":"2018-10-04T18:52:33Z","url":"https://github.com/python/mypy/issues/5738"}
| 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:fa662f24-c6fe-5ca6-5ffd-02a5d7e8d6ac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9F8:30E5B0:2384031:2E27FB3:6AFFEB2C |
| html-safe-nonce | b97f450628ac4454a58715edfb9fbe4e8aeb88fdad278407b4c50db6eb6cc4d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUY4OjMwRTVCMDoyMzg0MDMxOjJFMjdGQjM6NkFGRkVCMkMiLCJ2aXNpdG9yX2lkIjoiNjA4Nzc1ODMxMjk2OTg1NzgzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a821b791d73aa72fad4952505b44719cfd7863cbc51e5bea37a62abf81fadae |
| hovercard-subject-tag | issue:366923569 |
| 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/5738/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42b0b973e0d39b63d252078f5ab3800bb32bbf0fcc6b8a8e64f337df3b28ee57/python/mypy/issues/5738 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42b0b973e0d39b63d252078f5ab3800bb32bbf0fcc6b8a8e64f337df3b28ee57/python/mypy/issues/5738 |
| og:image:alt | Since #5699, mypy now rejects the following program (minimized from a few failures at dropbox): from typing import TypeVar, Callable, Tuple T = TypeVar('T') def f(x: Callable[..., T]) -> T: return ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | msullivan |
| 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