Title: Possible bug: "Too many arguments for" error depends on presence of annotations in calling method signature. · Issue #9072 · python/mypy · GitHub
Open Graph Title: Possible bug: "Too many arguments for" error depends on presence of annotations in calling method signature. · Issue #9072 · python/mypy
X Title: Possible bug: "Too many arguments for" error depends on presence of annotations in calling method signature. · Issue #9072 · python/mypy
Description: mypy checks the following without error: # tmp.py def xyz(): ... def caller(self, a, **kwargs): print(a) xyz(**kwargs) However, I get an error when I add a type signature to the argument a in caller: # tmp_with_signature.py def xyz(): .....
Open Graph Description: mypy checks the following without error: # tmp.py def xyz(): ... def caller(self, a, **kwargs): print(a) xyz(**kwargs) However, I get an error when I add a type signature to the argument a in calle...
X Description: mypy checks the following without error: # tmp.py def xyz(): ... def caller(self, a, **kwargs): print(a) xyz(**kwargs) However, I get an error when I add a type signature to the argument a in calle...
Opengraph URL: https://github.com/python/mypy/issues/9072
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible bug: \"Too many arguments for\" error depends on presence of annotations in calling method signature.","articleBody":"mypy checks the following without error:\r\n```\r\n# tmp.py\r\ndef xyz():\r\n ...\r\ndef caller(self, a, **kwargs):\r\n print(a)\r\n xyz(**kwargs)\r\n```\r\n\r\nHowever, I get an error when I add a type signature to the argument `a` in `caller`:\r\n```\r\n# tmp_with_signature.py\r\ndef xyz():\r\n ...\r\ndef caller(self, a: int, **kwargs):\r\n print(a)\r\n xyz(**kwargs)\r\n```\r\nMypy gives the following error message:\r\n```\r\n$ mypy tmp_with_signature.py\r\ntmp_with_signature.py:6: error: Too many arguments for \"xyz\"\r\nFound 1 error in 1 file (checked 1 source file)\r\n```\r\n\r\nIt is strange to me that the error is only reported when `a` has an annotation, which seems unrelated to the number keyword arguments being passed to `xyz`. If I change each instance of `**kwargs` to `*args`, the error goes away. Seems like a bug...\r\n\r\nMypy version: 0.790+dev.007b7af9f96df9d23744d93fdf54e83bcdc01630\r\nCPython version: 3.8.3","author":{"url":"https://github.com/Jasha10","@type":"Person","name":"Jasha10"},"datePublished":"2020-06-30T07:28:26Z","url":"https://github.com/python/mypy/issues/9072"}
| 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:541f579a-44da-80dd-4454-c08ed4401771 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9550:DCDA8:29EF18D:36DD39E:6B000A60 |
| html-safe-nonce | f87e61814024d5b91274dc2c00bb82682674b114ea49c2648cccc80684b32152 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTUwOkRDREE4OjI5RUYxOEQ6MzZERDM5RTo2QjAwMEE2MCIsInZpc2l0b3JfaWQiOiIxMjE1OTAyNTUwMzQ4MjcwMTc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 32fc5a894ded6a95656ec692d7845e9b27f03776c3d8f6e6f50847fc543d3e19 |
| hovercard-subject-tag | issue:647936514 |
| 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/9072/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bbef56eb2df01ace21c5812e5efdf374f843d543616436633fae03b246771458/python/mypy/issues/9072 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bbef56eb2df01ace21c5812e5efdf374f843d543616436633fae03b246771458/python/mypy/issues/9072 |
| og:image:alt | mypy checks the following without error: # tmp.py def xyz(): ... def caller(self, a, **kwargs): print(a) xyz(**kwargs) However, I get an error when I add a type signature to the argument a in calle... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jasha10 |
| 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