Title: Invalid signature for type object when both __init__ and __new__ · Issue #1435 · python/mypy · GitHub
Open Graph Title: Invalid signature for type object when both __init__ and __new__ · Issue #1435 · python/mypy
X Title: Invalid signature for type object when both __init__ and __new__ · Issue #1435 · python/mypy
Description: Mypy complains about the program even though it's valid Python: class A(object): def __init__(self, x): pass class B(A): def __new__(cls): return 1 B() # Too few arguments for "B" It seems that mypy uses __init__ and doesn't recognize th...
Open Graph Description: Mypy complains about the program even though it's valid Python: class A(object): def __init__(self, x): pass class B(A): def __new__(cls): return 1 B() # Too few arguments for "B" It seems that myp...
X Description: Mypy complains about the program even though it's valid Python: class A(object): def __init__(self, x): pass class B(A): def __new__(cls): return 1 B() # Too few arguments for "B" It ...
Opengraph URL: https://github.com/python/mypy/issues/1435
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invalid signature for type object when both __init__ and __new__","articleBody":"Mypy complains about the program even though it's valid Python:\n\n```\nclass A(object):\n def __init__(self, x):\n pass\n\nclass B(A):\n def __new__(cls):\n return 1\n\nB() # Too few arguments for \"B\"\n```\n\nIt seems that mypy uses `__init__` and doesn't recognize that `__new__` in a subclass should take precedence.\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2016-04-24T14:18:21Z","url":"https://github.com/python/mypy/issues/1435"}
| 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:d44454ad-a76c-68dd-0c8d-563fe56f63c9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AB0:4D1C6:2AF6E89:3AB1068:6B00575A |
| html-safe-nonce | 8d1773c65733527fc64e4f3478b991669d986181aa210ff7dd8b80adbf395579 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUIwOjREMUM2OjJBRjZFODk6M0FCMTA2ODo2QjAwNTc1QSIsInZpc2l0b3JfaWQiOiI0NDMwOTYwMjQ3NDQ3NzcwOTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fb025deba5d46993922e2e78371d86bad5acaacb2a5ddf803d111dfe136fe464 |
| hovercard-subject-tag | issue:150664914 |
| 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/1435/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc45270678020c87e66ea36def28eb9d4cd9dac011a0f41e2b6b4d03d843f3c6/python/mypy/issues/1435 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc45270678020c87e66ea36def28eb9d4cd9dac011a0f41e2b6b4d03d843f3c6/python/mypy/issues/1435 |
| og:image:alt | Mypy complains about the program even though it's valid Python: class A(object): def __init__(self, x): pass class B(A): def __new__(cls): return 1 B() # Too few arguments for "B" It seems that myp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| 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