Title: Erroneous 'Too many arguments' error · Issue #4997 · python/mypy · GitHub
Open Graph Title: Erroneous 'Too many arguments' error · Issue #4997 · python/mypy
X Title: Erroneous 'Too many arguments' error · Issue #4997 · python/mypy
Description: It appears as though mypy treats argument unpacking as containing at least one element. Here's an example: from typing import List class Foo: pass args: List[str] = [] packet = Foo(*args) tbug.py:7: error: Too many arguments for "Foo" I ...
Open Graph Description: It appears as though mypy treats argument unpacking as containing at least one element. Here's an example: from typing import List class Foo: pass args: List[str] = [] packet = Foo(*args) tbug.py:7...
X Description: It appears as though mypy treats argument unpacking as containing at least one element. Here's an example: from typing import List class Foo: pass args: List[str] = [] packet = Foo(*args) tbug....
Opengraph URL: https://github.com/python/mypy/issues/4997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Erroneous 'Too many arguments' error","articleBody":"It appears as though mypy treats argument unpacking as containing at least one element. Here's an example:\r\n\r\n```python\r\nfrom typing import List\r\n\r\nclass Foo:\r\n pass\r\n\r\nargs: List[str] = []\r\npacket = Foo(*args)\r\n```\r\n\r\n```\r\ntbug.py:7: error: Too many arguments for \"Foo\"\r\n```\r\n\r\nI guess Mypy is assuming that you would never unpack zero arguments.\r\n\r\nIn my particular case I have a registry of 'packet classes' and a dynamic number of arguments parsed from the network. Some of those packet classes legitimately have 0 parameters, and Mypy gives me an error about each of them.\r\n\r\nRunning `mypy 0.600` with no other flags.\r\n","author":{"url":"https://github.com/willmcgugan","@type":"Person","name":"willmcgugan"},"datePublished":"2018-05-03T15:37:57Z","url":"https://github.com/python/mypy/issues/4997"}
| 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:eb510d2f-cc5a-c39a-0909-fdfc6e2bb388 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED62:22E601:C158E5:103415C:6B004E54 |
| html-safe-nonce | 485672abe0619093cfa3cca1b5602dbf8496fec7a12a0dc39b14f840d11ba807 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDYyOjIyRTYwMTpDMTU4RTU6MTAzNDE1Qzo2QjAwNEU1NCIsInZpc2l0b3JfaWQiOiIyODY3MDM1MzE3NzgzNzc2ODUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fb9990a98956183f9dbf252d06caf715fbf11465ac8779d2e6ba7b3857dfd909 |
| hovercard-subject-tag | issue:319974058 |
| 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/4997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2c14690741eebd2d65fb8c6315f47d48a4fc1ec79cd6cf05498c3d389b73fc71/python/mypy/issues/4997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2c14690741eebd2d65fb8c6315f47d48a4fc1ec79cd6cf05498c3d389b73fc71/python/mypy/issues/4997 |
| og:image:alt | It appears as though mypy treats argument unpacking as containing at least one element. Here's an example: from typing import List class Foo: pass args: List[str] = [] packet = Foo(*args) tbug.py:7... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | willmcgugan |
| 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