Title: Callable has no attribute __kwdefaults__ · Issue #5958 · python/mypy · GitHub
Open Graph Title: Callable has no attribute __kwdefaults__ · Issue #5958 · python/mypy
X Title: Callable has no attribute __kwdefaults__ · Issue #5958 · python/mypy
Description: Here's an example (pycharm is also syntax highlighting it): def print_first_number_decorator(f: Callable[Any]) -> Callable: """Example decorator""" @functools.wraps(f) def wrapper(*args: List[Any], **kwargs: Dict[Any, Any]) -> int: print...
Open Graph Description: Here's an example (pycharm is also syntax highlighting it): def print_first_number_decorator(f: Callable[Any]) -> Callable: """Example decorator""" @functools.wraps(f) def wrapper(*args: List[Any],...
X Description: Here's an example (pycharm is also syntax highlighting it): def print_first_number_decorator(f: Callable[Any]) -> Callable: """Example decorator""" @functools.w...
Opengraph URL: https://github.com/python/mypy/issues/5958
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Callable has no attribute __kwdefaults__","articleBody":"Here's an example (pycharm is also syntax highlighting it):\r\n\r\n```python\r\ndef print_first_number_decorator(f: Callable[Any]) -> Callable:\r\n \"\"\"Example decorator\"\"\"\r\n \r\n @functools.wraps(f)\r\n def wrapper(*args: List[Any], **kwargs: Dict[Any, Any]) -> int:\r\n print(f.__kwdefaults__[\"num2\"]) # Callable[Any]\" has no attribute \"__kwdefaults__\"\r\n return f(*args)\r\n \r\n return wrapper\r\n \r\n \r\n@print_first_number_decorator\r\ndef add_(num1=3, *, num2=4) -> int:\r\n return num1 + num2\r\n \r\n \r\nif __name__ == \"__main__\":\r\n print(add_(5))\r\n```\r\n\r\n Mypy error: `error: \"Callable[Any]\" has no attribute \"__kwdefaults__\"`","author":{"url":"https://github.com/ahmedsoe","@type":"Person","name":"ahmedsoe"},"datePublished":"2018-11-27T10:50:47Z","url":"https://github.com/python/mypy/issues/5958"}
| 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:f25f1903-73f1-ae24-468c-ec8f4edda162 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B324:3B60C0:CE7F8B:113AAD6:6B005078 |
| html-safe-nonce | d68a57c79b72427577bf9750573203a6582ef8a520d41539bcc919d8d5e3e919 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzI0OjNCNjBDMDpDRTdGOEI6MTEzQUFENjo2QjAwNTA3OCIsInZpc2l0b3JfaWQiOiI3NDM2NzAzOTM2NDE5MTQ0ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 32ffd2f1d14d11ec065a0832f9659d38de1890d5525324d6a181151e92078aa9 |
| hovercard-subject-tag | issue:384734155 |
| 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/5958/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1089b2142c6bb1543d08f1a8f1f2dc6a1d4ccb98bd30b6352395fdeb23c19e9b/python/mypy/issues/5958 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1089b2142c6bb1543d08f1a8f1f2dc6a1d4ccb98bd30b6352395fdeb23c19e9b/python/mypy/issues/5958 |
| og:image:alt | Here's an example (pycharm is also syntax highlighting it): def print_first_number_decorator(f: Callable[Any]) -> Callable: """Example decorator""" @functools.wraps(f) def wrapper(*args: List[Any],... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ahmedsoe |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width