Title: mypy fails to consider the case where *args or **kwds contains zero elements · Issue #4001 · python/mypy · GitHub
Open Graph Title: mypy fails to consider the case where *args or **kwds contains zero elements · Issue #4001 · python/mypy
X Title: mypy fails to consider the case where *args or **kwds contains zero elements · Issue #4001 · python/mypy
Description: Minimum repro: object(*[]) object(**{}) This gives the following errors: Too many arguments for "object" Too many arguments for "object" I think this is valid code and should pass the type check. Context: I encountered this when I tried ...
Open Graph Description: Minimum repro: object(*[]) object(**{}) This gives the following errors: Too many arguments for "object" Too many arguments for "object" I think this is valid code and should pass the type check. C...
X Description: Minimum repro: object(*[]) object(**{}) This gives the following errors: Too many arguments for "object" Too many arguments for "object" I think this is valid code and should pa...
Opengraph URL: https://github.com/python/mypy/issues/4001
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy fails to consider the case where *args or **kwds contains zero elements","articleBody":"Minimum repro:\r\n\r\n```python\r\nobject(*[])\r\nobject(**{})\r\n```\r\n\r\nThis gives the following errors:\r\n\r\n```\r\nToo many arguments for \"object\"\r\nToo many arguments for \"object\"\r\n```\r\n\r\nI think this is valid code and should pass the type check.\r\n\r\nContext: I encountered this when I tried to write a multiple inheritance model where each class is passing arguments to the next parent (in terms of MRO):\r\n\r\n```python\r\nclass A(object):\r\n def __init__(self, a_arg: int, **kwds: Any) -> None:\r\n super().__init__(**kwds)\r\n\r\nclass B(object):\r\n def __init__(self, b_arg: int, **kwds: Any) -> None:\r\n super().__init__(**kwds)\r\n\r\nclass C(A, B):\r\n def __init__(self, c_arg: int, **kwds: Any) -> None:\r\n super().__init__(**kwds)\r\n\r\nC(a_arg=1, b_arg=2, c_arg=3)\r\n\r\n# This code runs fine but gives three type errors saying:\r\n# Too many arguments for \"__init__\" of \"object\"\r\n```\r\n\r\nYou cannot expect a static derivation order due to the dynamic nature of MRO, so it's hard to avoid this error from happening.","author":{"url":"https://github.com/yutak","@type":"Person","name":"yutak"},"datePublished":"2017-09-25T04:09:21Z","url":"https://github.com/python/mypy/issues/4001"}
| 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:7919923f-26d3-6a83-da03-2756ab11d24b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8F4:390AA2:230C96C:2FBFDCA:6B002ADC |
| html-safe-nonce | 20de88e157923d38cd0517d5ae7cceaa5a834ade1ff014a2046aaec5b8e1afdf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEY0OjM5MEFBMjoyMzBDOTZDOjJGQkZEQ0E6NkIwMDJBREMiLCJ2aXNpdG9yX2lkIjoiMTU5MzE0NDgxODAzOTUzMjI1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 73c614c3d7c78d3b80c8358c398098dc2b6b86b4f0a149cd6204f17116f98d8f |
| hovercard-subject-tag | issue:260149825 |
| 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/4001/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b3f512a67fa5910847039da6072fc08dcad60bbc3a4bdf71422e8c3d775fea9/python/mypy/issues/4001 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b3f512a67fa5910847039da6072fc08dcad60bbc3a4bdf71422e8c3d775fea9/python/mypy/issues/4001 |
| og:image:alt | Minimum repro: object(*[]) object(**{}) This gives the following errors: Too many arguments for "object" Too many arguments for "object" I think this is valid code and should pass the type check. C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yutak |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width