Title: using a decorator on an overloaded function where the decorator uses `Concatenate` causes false positive "Overloaded function implementation does not accept all possible arguments" error · Issue #17459 · python/mypy · GitHub
Open Graph Title: using a decorator on an overloaded function where the decorator uses `Concatenate` causes false positive "Overloaded function implementation does not accept all possible arguments" error · Issue #17459 · python/mypy
X Title: using a decorator on an overloaded function where the decorator uses `Concatenate` causes false positive "Overloaded function implementation does not accept all possible arguments" error · Issue #17459 · python/mypy
Description: from typing import Callable, Concatenate, TypeVar, overload, ParamSpec T = TypeVar("T") P = ParamSpec("P") R = TypeVar("R") def foo(fn: Callable[Concatenate[T, P], R]) -> Callable[Concatenate[T, P], R]: return fn class Foo: @overload def...
Open Graph Description: from typing import Callable, Concatenate, TypeVar, overload, ParamSpec T = TypeVar("T") P = ParamSpec("P") R = TypeVar("R") def foo(fn: Callable[Concatenate[T, P], R]) -> Callable[Concatenate[T, P]...
X Description: from typing import Callable, Concatenate, TypeVar, overload, ParamSpec T = TypeVar("T") P = ParamSpec("P") R = TypeVar("R") def foo(fn: Callable[Concatenate[T, P], R])...
Opengraph URL: https://github.com/python/mypy/issues/17459
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"using a decorator on an overloaded function where the decorator uses `Concatenate` causes false positive \"Overloaded function implementation does not accept all possible arguments\" error","articleBody":"```py\r\nfrom typing import Callable, Concatenate, TypeVar, overload, ParamSpec\r\n\r\nT = TypeVar(\"T\")\r\nP = ParamSpec(\"P\")\r\nR = TypeVar(\"R\")\r\n\r\n\r\ndef foo(fn: Callable[Concatenate[T, P], R]) -> Callable[Concatenate[T, P], R]:\r\n return fn\r\n\r\n\r\nclass Foo:\r\n @overload\r\n def bar(self, a: str) -> str: ...\r\n @overload\r\n def bar(self, a: int) -> int: ...\r\n\r\n # error: Overloaded function implementation does not accept all possible arguments of signature 1\r\n # error: Overloaded function implementation does not accept all possible arguments of signature 2\r\n @foo\r\n def bar(self, a: object) -> object: ...\r\n```\r\n[playground](https://mypy-play.net/?mypy=latest&python=3.12&flags=show-error-codes%2Cstrict%2Ccheck-untyped-defs%2Cdisallow-any-decorated%2Cdisallow-any-expr%2Cdisallow-any-explicit%2Cdisallow-any-generics%2Cdisallow-any-unimported%2Cdisallow-incomplete-defs%2Cdisallow-subclassing-any%2Cdisallow-untyped-calls%2Cdisallow-untyped-decorators%2Cdisallow-untyped-defs%2Cno-implicit-reexport%2Clocal-partial-types%2Cwarn-redundant-casts%2Cwarn-return-any%2Cwarn-unreachable%2Cwarn-unused-configs%2Cwarn-unused-ignores&gist=f12c4be02d47e7ba9768f55e4f9b4834)","author":{"url":"https://github.com/DetachHead","@type":"Person","name":"DetachHead"},"datePublished":"2024-07-01T02:26:58Z","url":"https://github.com/python/mypy/issues/17459"}
| 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:0d851d0d-70e2-73be-63da-bfaebd2206f6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B16C:23D776:107EF97:15C844E:6B000CD8 |
| html-safe-nonce | 45234a4e9c1d32eec0d806de920e4aa09e890ded72b351bd41b3ee62565f0945 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTZDOjIzRDc3NjoxMDdFRjk3OjE1Qzg0NEU6NkIwMDBDRDgiLCJ2aXNpdG9yX2lkIjoiNDI0MTQ1NjM1OTM2MDQ2Mjk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a9a0fd9eed60ca3cfc3e1c4230d7ed2cf6b520dfb4f288fd74528773c915fbe0 |
| hovercard-subject-tag | issue:2382658715 |
| 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/17459/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bba863fe43ae4af1637fb1906c23917249b52d29623c93a5d485d5b45714981/python/mypy/issues/17459 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bba863fe43ae4af1637fb1906c23917249b52d29623c93a5d485d5b45714981/python/mypy/issues/17459 |
| og:image:alt | from typing import Callable, Concatenate, TypeVar, overload, ParamSpec T = TypeVar("T") P = ParamSpec("P") R = TypeVar("R") def foo(fn: Callable[Concatenate[T, P], R]) -> Callable[Concatenate[T, P]... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DetachHead |
| hostname | github.com |
| expected-hostname | github.com |
| None | cf7ee0062053ad9eb05b6e5de57bd96c2055708bcbada4144946b5ec129cf1d7 |
| 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 | 9cab7de176a56362d2aabcbb4d1e07e846eba8a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width