Title: Multiple inheritance: Cannot determine type of "X" in base class "Y" error · Issue #2871 · python/mypy · GitHub
Open Graph Title: Multiple inheritance: Cannot determine type of "X" in base class "Y" error · Issue #2871 · python/mypy
X Title: Multiple inheritance: Cannot determine type of "X" in base class "Y" error · Issue #2871 · python/mypy
Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Open Graph Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
X Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
Opengraph URL: https://github.com/python/mypy
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Multiple inheritance: Cannot determine type of \"X\" in base class \"Y\" error","articleBody":"This is probably more of a question than a real issue.\r\n\r\nThe following code is considered erroneous (tested in Python 3):\r\n\r\n```python\r\nclass BaseA:\r\n class Sub:\r\n pass\r\n\r\nclass BaseB:\r\n class Sub:\r\n pass\r\n\r\nclass Test(BaseA, BaseB):\r\n pass\r\n```\r\n\r\nmypy responds with:\r\n\r\n```\r\n…: error: Cannot determine type of 'Sub' in base class 'BaseA'\r\n…: error: Cannot determine type of 'Sub' in base class 'BaseB'\r\n```\r\n\r\nBut it doesn't complain if I don't use multiple inheritance:\r\n\r\n```python\r\nclass BaseA:\r\n class Sub:\r\n pass\r\n\r\nclass BaseB:\r\n class Sub:\r\n pass\r\n\r\nclass Test(BaseA):\r\n pass\r\n```","author":{"url":"https://github.com/syenchuk","@type":"Person","name":"syenchuk"},"datePublished":"2017-02-15T16:13:41Z","url":"https://github.com/python/mypy/issues/2871"}
| 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 | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:e6588a2f-903d-7e18-a844-b14a54b40a0b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A48:30263F:1F9C18B:2AEE47B:6B001B25 |
| html-safe-nonce | ff0eec87a56ac17bd8aebe45b703a8a3e375d32f9c97183fd13fd942d91f567c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTQ4OjMwMjYzRjoxRjlDMThCOjJBRUU0N0I6NkIwMDFCMjUiLCJ2aXNpdG9yX2lkIjoiNzA2MzY5MjYyOTE0OTQ4OTk1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 90e9a5ac9ac36c6417fd88e021d69f52b5e89fba4ec5683ee269527eb34c43e3 |
| hovercard-subject-tag | repository:7053637 |
| 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/python/mypy/issues/2871 |
| twitter:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f79ae5636353a0db17350af0a02700f2e9c3bbcf096f9450bf0c369c77cd1022/python/mypy |
| og:image:alt | Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-cache |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width