Title: PEP-612 ParamSpec with high-order function error. · Issue #12595 · python/mypy · GitHub
Open Graph Title: PEP-612 ParamSpec with high-order function error. · Issue #12595 · python/mypy
X Title: PEP-612 ParamSpec with high-order function error. · Issue #12595 · python/mypy
Description: mypy==0.950 from https://github.com/python/mypy/tree/release-0.950 python==3.9.11 from typing import TypeVar, Callable from typing_extensions import Concatenate, ParamSpec, Protocol T_co = TypeVar('T_co', covariant=True) T = TypeVar('T')...
Open Graph Description: mypy==0.950 from https://github.com/python/mypy/tree/release-0.950 python==3.9.11 from typing import TypeVar, Callable from typing_extensions import Concatenate, ParamSpec, Protocol T_co = TypeVar(...
X Description: mypy==0.950 from https://github.com/python/mypy/tree/release-0.950 python==3.9.11 from typing import TypeVar, Callable from typing_extensions import Concatenate, ParamSpec, Protocol T_co = TypeVar(...
Opengraph URL: https://github.com/python/mypy/issues/12595
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PEP-612 ParamSpec with high-order function error.","articleBody":"mypy==0.950 from https://github.com/python/mypy/tree/release-0.950\r\npython==3.9.11\r\n```python\r\nfrom typing import TypeVar, Callable\r\nfrom typing_extensions import Concatenate, ParamSpec, Protocol\r\n\r\nT_co = TypeVar('T_co', covariant=True)\r\nT = TypeVar('T')\r\nP = ParamSpec('P')\r\n\r\nclass Wrapped(Protocol[P, T_co]):\r\n def __call__(self, *args: P.args, **kwargs: P.kwargs) -> T_co:\r\n pass\r\n\r\ndef jit(f: Callable[P, T], *, a: bool) -> Wrapped[P, T]:\r\n return f\r\n\r\n_T = TypeVar('_T')\r\n_P = ParamSpec('_P')\r\n\r\ndef _make_factory(\r\n transform: Callable[Concatenate[Callable[P, T], _P], _T]\r\n) -> Callable[_P, Callable[[Callable[P, T]], _T]]:\r\n return lambda *args, **kwargs: lambda f: transform(f, *args, **kwargs)\r\n\r\n_make_jit = _make_factory(jit)\r\n@_make_jit(a=True) # line 24\r\ndef f(x: int, y: int):\r\n return x + y\r\n\r\nf(0, 0) # line 28\r\n```\r\n```\r\nparamspec.py:24: error: Argument 1 has incompatible type \"Callable[[int, int], Any]\"; expected \"Callable[[VarArg(\u003cnothing>), KwArg(\u003cnothing>)], \u003cnothing>]\"\r\nparamspec.py:28: error: Argument 1 to \"__call__\" of \"Wrapped\" has incompatible type \"int\"; expected \u003cnothing>\r\nparamspec.py:28: error: Argument 2 to \"__call__\" of \"Wrapped\" has incompatible type \"int\"; expected \u003cnothing>\r\nFound 3 errors in 1 file (checked 1 source file\r\n```\r\n","author":{"url":"https://github.com/YouJiacheng","@type":"Person","name":"YouJiacheng"},"datePublished":"2022-04-15T19:05:57Z","url":"https://github.com/python/mypy/issues/12595"}
| 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:4bfc068b-892c-7019-081f-113148633e63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB58:381DB6:ED2D04:13427AC:6AFFF19C |
| html-safe-nonce | 9cce81bdb223bdea3b79ee522d5a47749b22c8d198c6b00f2f833345b0eec1e1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjU4OjM4MURCNjpFRDJEMDQ6MTM0MjdBQzo2QUZGRjE5QyIsInZpc2l0b3JfaWQiOiI1OTIwOTI4MzUyODMwNDg0ODkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a1ea305348753d1062c07deda8607b76e3efd522866e47eb2de109455fa2a81d |
| hovercard-subject-tag | issue:1205802193 |
| 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/12595/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d15af8b686a3166aecd96329625606f3521f390242c0b44492832d5d63161310/python/mypy/issues/12595 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d15af8b686a3166aecd96329625606f3521f390242c0b44492832d5d63161310/python/mypy/issues/12595 |
| og:image:alt | mypy==0.950 from https://github.com/python/mypy/tree/release-0.950 python==3.9.11 from typing import TypeVar, Callable from typing_extensions import Concatenate, ParamSpec, Protocol T_co = TypeVar(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | YouJiacheng |
| 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