Title: Constraint solver regression in mypy 1.7.1 · Issue #16582 · python/mypy · GitHub
Open Graph Title: Constraint solver regression in mypy 1.7.1 · Issue #16582 · python/mypy
X Title: Constraint solver regression in mypy 1.7.1 · Issue #16582 · python/mypy
Description: Mypy 1.6.1 didn't produce any errors in this code, but 1.7.0 does. Link to mypy playground from typing import Callable, Generic, TypeVar A = TypeVar("A") B = TypeVar("B") class Gen(Generic[A]): ... def id_(x: A) -> A: raise NotImplemente...
Open Graph Description: Mypy 1.6.1 didn't produce any errors in this code, but 1.7.0 does. Link to mypy playground from typing import Callable, Generic, TypeVar A = TypeVar("A") B = TypeVar("B") class Gen(Generic[A]): ......
X Description: Mypy 1.6.1 didn't produce any errors in this code, but 1.7.0 does. Link to mypy playground from typing import Callable, Generic, TypeVar A = TypeVar("A") B = TypeVar("B") cl...
Opengraph URL: https://github.com/python/mypy/issues/16582
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Constraint solver regression in mypy 1.7.1","articleBody":"Mypy 1.6.1 didn't produce any errors in this code, but 1.7.0 does.\r\n\r\nLink to [mypy playground](https://mypy-play.net/?mypy=1.7.0&python=3.11&gist=135eba4b938aea41286374cfcf962db0)\r\n\r\n```python\r\nfrom typing import Callable, Generic, TypeVar\r\n\r\nA = TypeVar(\"A\")\r\nB = TypeVar(\"B\")\r\n\r\nclass Gen(Generic[A]): ...\r\n\r\ndef id_(x: A) -> A:\r\n raise NotImplementedError()\r\n\r\ndef bstep(\r\n x: Gen[A],\r\n y: A,\r\n) -> Gen[Gen[A]]:\r\n raise NotImplementedError()\r\n\r\ndef bfn(\r\n x: Gen[Gen[A]],\r\n) -> Gen[A]:\r\n return bfn_generic(x, id_, bstep) # False positive error here\r\n\r\ndef bfn_generic(\r\n x: Gen[A],\r\n id_: Callable[[B], B],\r\n step: Callable[[A, B], Gen[A]],\r\n) -> A:\r\n raise NotImplementedError()\r\n```\r\n\r\nNote that pyright has a similar bug in its constraint solver, which is how I became aware of this issue. Here's the [original pyright bug report](https://github.com/microsoft/pyright/issues/5855).","author":{"url":"https://github.com/erictraut","@type":"Person","name":"erictraut"},"datePublished":"2023-11-28T22:23:36Z","url":"https://github.com/python/mypy/issues/16582"}
| 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:e0940c12-d0fa-8e4c-a4ef-911fd198811d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DBBC:1AF0B6:14FDF3B:1B79468:6B000BFC |
| html-safe-nonce | 6dd286381ca92feb2804451c57a8c5e0b55a58d043ce20cd79cc1a9cdeaba20c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkJDOjFBRjBCNjoxNEZERjNCOjFCNzk0Njg6NkIwMDBCRkMiLCJ2aXNpdG9yX2lkIjoiNDI1MTY4MDgwNDkwOTg3ODI2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fffa2bf8ddbcbbbf2e7db07a4898f517763ad655e6d287b1d2317e51bad56714 |
| hovercard-subject-tag | issue:2015425894 |
| 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/16582/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1a8c27ef20590dbe7a9a3b57c61b3297c9425eaad8823da4c8cc46b7367d08ab/python/mypy/issues/16582 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1a8c27ef20590dbe7a9a3b57c61b3297c9425eaad8823da4c8cc46b7367d08ab/python/mypy/issues/16582 |
| og:image:alt | Mypy 1.6.1 didn't produce any errors in this code, but 1.7.0 does. Link to mypy playground from typing import Callable, Generic, TypeVar A = TypeVar("A") B = TypeVar("B") class Gen(Generic[A]): ...... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erictraut |
| 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