Title: Multiple dict unpacking for function arguments gives type error · Issue #4708 · python/mypy · GitHub
Open Graph Title: Multiple dict unpacking for function arguments gives type error · Issue #4708 · python/mypy
X Title: Multiple dict unpacking for function arguments gives type error · Issue #4708 · python/mypy
Description: When I run the following code through MyPy: def fn(a: int, b: int, c: int) -> None: print((a, b, c)) fn(**{'a': 10}, **{'b': 20, 'c': 30}) I receive the following: $ python -m mypy mypy_problem.py mypy_problem.py:8: error: Too many argum...
Open Graph Description: When I run the following code through MyPy: def fn(a: int, b: int, c: int) -> None: print((a, b, c)) fn(**{'a': 10}, **{'b': 20, 'c': 30}) I receive the following: $ python -m mypy mypy_problem.py ...
X Description: When I run the following code through MyPy: def fn(a: int, b: int, c: int) -> None: print((a, b, c)) fn(**{'a': 10}, **{'b': 20, 'c': 30}) I receive the following: $ pyth...
Opengraph URL: https://github.com/python/mypy/issues/4708
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Multiple dict unpacking for function arguments gives type error","articleBody":"When I run the following code through MyPy:\r\n```\r\ndef fn(a: int, b: int, c: int) -> None:\r\n print((a, b, c))\r\n\r\nfn(**{'a': 10}, **{'b': 20, 'c': 30})\r\n```\r\nI receive the following:\r\n```\r\n$ python -m mypy mypy_problem.py\r\nmypy_problem.py:8: error: Too many arguments for \"fn\"\r\n```\r\n\r\nI expect this to not give an error because as far as I know it's valid python code - it works at least! A workaround is to wrap the whole thing in another dictionary, i.e.:\r\n```\r\nfn(**{**{'a': 10}, **{'b': 20, 'c': 30}})\r\n```\r\nBut this is messy and possibly introduces an additional overhead.\r\n```\r\n$ conda list | grep 'python\\|mypy\\|typed-ast'\r\nmypy 0.570 \u003cpip>\r\npython 3.5.2 0 conda-forge\r\ntyped-ast 1.1.0 \u003cpip>\r\n```\r\nI'm using Windows 7 64-bit.","author":{"url":"https://github.com/bmerrison","@type":"Person","name":"bmerrison"},"datePublished":"2018-03-09T11:27:54Z","url":"https://github.com/python/mypy/issues/4708"}
| 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:e7742f9d-6f5f-152f-ae6a-3e9cbc4ca6ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D902:7F150:21DCA69:2CF1F9B:6B0049CA |
| html-safe-nonce | 019f84ae8ae1ad8b818680bad979504cb751bab0c68a857623a93566c51df2c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTAyOjdGMTUwOjIxRENBNjk6MkNGMUY5Qjo2QjAwNDlDQSIsInZpc2l0b3JfaWQiOiIyOTU3ODA2OTQzMzIzODM0ODI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 06800d1a3d1420649e5030cae61ae7b845a3d240e878645afb6cfce28c2fe7c9 |
| hovercard-subject-tag | issue:303810559 |
| 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/4708/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3953b28f9928d63a5ea32f7eae343c73d7d36b252a4b868304dd9347a929c0c7/python/mypy/issues/4708 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3953b28f9928d63a5ea32f7eae343c73d7d36b252a4b868304dd9347a929c0c7/python/mypy/issues/4708 |
| og:image:alt | When I run the following code through MyPy: def fn(a: int, b: int, c: int) -> None: print((a, b, c)) fn(**{'a': 10}, **{'b': 20, 'c': 30}) I receive the following: $ python -m mypy mypy_problem.py ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bmerrison |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width