Title: ParamSpec parameters don't match __init__ parameters of class · Issue #12986 · python/mypy · GitHub
Open Graph Title: ParamSpec parameters don't match __init__ parameters of class · Issue #12986 · python/mypy
X Title: ParamSpec parameters don't match __init__ parameters of class · Issue #12986 · python/mypy
Description: from functools import partial from typing import Callable, Generic, ParamSpec P = ParamSpec('P') class custom_vjp(Generic[P]): def __init__(self, fun: Callable[P, None], x: int = 0): super().__init__() self.fun = fun def __call__(self, *...
Open Graph Description: from functools import partial from typing import Callable, Generic, ParamSpec P = ParamSpec('P') class custom_vjp(Generic[P]): def __init__(self, fun: Callable[P, None], x: int = 0): super().__init...
X Description: from functools import partial from typing import Callable, Generic, ParamSpec P = ParamSpec('P') class custom_vjp(Generic[P]): def __init__(self, fun: Callable[P, None], x: int = 0): super(...
Opengraph URL: https://github.com/python/mypy/issues/12986
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ParamSpec parameters don't match __init__ parameters of class ","articleBody":"```python\r\nfrom functools import partial\r\nfrom typing import Callable, Generic, ParamSpec\r\n\r\nP = ParamSpec('P')\r\n\r\nclass custom_vjp(Generic[P]):\r\n def __init__(self,\r\n fun: Callable[P, None],\r\n x: int = 0):\r\n super().__init__()\r\n self.fun = fun\r\n\r\n def __call__(self, *args: P.args, **kwargs: P.kwargs) -> None:\r\n return self.fun(*args, **kwargs)\r\n\r\n@partial(custom_vjp, x=1) # error: Argument 1 to \"partial\" has incompatible type \"Type[custom_vjp[Any]]\"; expected \"Callable[..., custom_vjp[P]]\"\r\ndef f() -> None:\r\n pass\r\n```","author":{"url":"https://github.com/NeilGirdhar","@type":"Person","name":"NeilGirdhar"},"datePublished":"2022-06-15T10:16:31Z","url":"https://github.com/python/mypy/issues/12986"}
| 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:79e91a7e-ebfd-db65-be49-7955d55c2915 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E686:100874:11ABC01:1739B07:6B000BE4 |
| html-safe-nonce | 683cdbdea980c9fb86cbb87c156d5d3d294b50ef0662c057c1f951129571b86f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjg2OjEwMDg3NDoxMUFCQzAxOjE3MzlCMDc6NkIwMDBCRTQiLCJ2aXNpdG9yX2lkIjoiODk1MjM5MjM2NDI4Mjg3NDg1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0c489610376740cbbd7761ab73fec017b4c884c9c9f3943d5945272f2df28c36 |
| hovercard-subject-tag | issue:1272004787 |
| 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/12986/issue_layout |
| twitter:image | https://opengraph.githubassets.com/195e191541cf83892ed493b3e8acac97ddb814965bcd5d77f7b64e9130c4c0e8/python/mypy/issues/12986 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/195e191541cf83892ed493b3e8acac97ddb814965bcd5d77f7b64e9130c4c0e8/python/mypy/issues/12986 |
| og:image:alt | from functools import partial from typing import Callable, Generic, ParamSpec P = ParamSpec('P') class custom_vjp(Generic[P]): def __init__(self, fun: Callable[P, None], x: int = 0): super().__init... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NeilGirdhar |
| 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