Title: Join computed suboptimally with multiple inheritance · Issue #4373 · python/mypy · GitHub
Open Graph Title: Join computed suboptimally with multiple inheritance · Issue #4373 · python/mypy
X Title: Join computed suboptimally with multiple inheritance · Issue #4373 · python/mypy
Description: class Base: def foo(self): pass class Mix: pass class A(Mix, Base): pass class B(Mix, Base): pass def foo() -> None: a = [A(), B()] reveal_type(a) # Shows Mix a.foo() # E: "Mix" has no attribute "foo" Could we do something better here? I...
Open Graph Description: class Base: def foo(self): pass class Mix: pass class A(Mix, Base): pass class B(Mix, Base): pass def foo() -> None: a = [A(), B()] reveal_type(a) # Shows Mix a.foo() # E: "Mix" has no attribute "f...
X Description: class Base: def foo(self): pass class Mix: pass class A(Mix, Base): pass class B(Mix, Base): pass def foo() -> None: a = [A(), B()] reveal_type(a) # Shows Mix a.foo() # E: "Mix" has no...
Opengraph URL: https://github.com/python/mypy/issues/4373
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Join computed suboptimally with multiple inheritance","articleBody":"```py\r\nclass Base:\r\n def foo(self): pass\r\n\r\nclass Mix: pass\r\n\r\nclass A(Mix, Base): pass\r\n\r\nclass B(Mix, Base): pass\r\n\r\ndef foo() -> None:\r\n a = [A(), B()]\r\n reveal_type(a) # Shows Mix\r\n a.foo() # E: \"Mix\" has no attribute \"foo\"\r\n```\r\nCould we do something better here? Ideally the inferred type of `a` should be an anonymous subclass of `Mix` and `Base`.","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2017-12-15T21:57:11Z","url":"https://github.com/python/mypy/issues/4373"}
| 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:f9213e2f-07ee-8c24-e0cb-cb2652ee91af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA56:59847:4AA9F4:6483D3:6B002F2F |
| html-safe-nonce | cbd214c386c87f29366d2715ff01f85f7f004aa997aaf99afb31626b2dfff1f6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTU2OjU5ODQ3OjRBQTlGNDo2NDgzRDM6NkIwMDJGMkYiLCJ2aXNpdG9yX2lkIjoiNjMwNzc3NzMxMTMxMTY3MTA4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | be006b8c9f3a43c813e9b100d89532f0f0f9fdae0184eab5a8878538e323c286 |
| hovercard-subject-tag | issue:282558664 |
| 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/4373/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb3f718301cac4360f59f1e1bab93ee1a0b8db3d5754738cd26b24e7eb33c386/python/mypy/issues/4373 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb3f718301cac4360f59f1e1bab93ee1a0b8db3d5754738cd26b24e7eb33c386/python/mypy/issues/4373 |
| og:image:alt | class Base: def foo(self): pass class Mix: pass class A(Mix, Base): pass class B(Mix, Base): pass def foo() -> None: a = [A(), B()] reveal_type(a) # Shows Mix a.foo() # E: "Mix" has no attribute "f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| 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