Title: "Cannot determine type" on inner class inheritance · Issue #5914 · python/mypy · GitHub
Open Graph Title: "Cannot determine type" on inner class inheritance · Issue #5914 · python/mypy
X Title: "Cannot determine type" on inner class inheritance · Issue #5914 · python/mypy
Description: I run mypy on the following code, with no arguments other than the file name: class InnerBase: pass class OuterBase: class Inner(InnerBase): pass class OuterMixin: class Inner(InnerBase): pass class Outer(OuterBase, OuterMixin): pass The...
Open Graph Description: I run mypy on the following code, with no arguments other than the file name: class InnerBase: pass class OuterBase: class Inner(InnerBase): pass class OuterMixin: class Inner(InnerBase): pass clas...
X Description: I run mypy on the following code, with no arguments other than the file name: class InnerBase: pass class OuterBase: class Inner(InnerBase): pass class OuterMixin: class Inner(InnerBase): pass clas...
Opengraph URL: https://github.com/python/mypy/issues/5914
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Cannot determine type\" on inner class inheritance","articleBody":"I run mypy on the following code, with no arguments other than the file name:\r\n```python\r\nclass InnerBase:\r\n pass\r\n\r\nclass OuterBase:\r\n class Inner(InnerBase):\r\n pass\r\n\r\nclass OuterMixin:\r\n class Inner(InnerBase):\r\n pass\r\n\r\nclass Outer(OuterBase, OuterMixin):\r\n pass\r\n```\r\nThe output that I get is as follows:\r\n```\r\ninner.py:12: error: Cannot determine type of 'Inner' in base class 'OuterBase'\r\ninner.py:12: error: Cannot determine type of 'Inner' in base class 'OuterMixin'\r\n```\r\nLine 12 is the line that starts with `class Outer`.\r\n\r\nI don't understand why the types cannot be determined: `Type[OuterBase.Inner]` and `Type[OuterMixin.Inner]` respectively would be the types for the inner classes, I think.\r\n\r\nNote that the errors go away when `Outer` inherits only from `OuterBase` or only from `OuterMixin`.\r\n\r\nI'm using mypy 0.641 on Python 3.6.5.\r\n","author":{"url":"https://github.com/mthuurne","@type":"Person","name":"mthuurne"},"datePublished":"2018-11-19T12:35:10Z","url":"https://github.com/python/mypy/issues/5914"}
| 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:1a7cc618-9b37-be3e-867c-285574fc0909 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F72:34D604:196623C:218FC6F:6B002AB0 |
| html-safe-nonce | 056561737b0904b36d035eaf8eb433e77e6af4ff3df671b53e758e9b6cbc5c18 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjcyOjM0RDYwNDoxOTY2MjNDOjIxOEZDNkY6NkIwMDJBQjAiLCJ2aXNpdG9yX2lkIjoiNjg4NjYyODYyOTUyNzE0NTEzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 356052fa9554e757aac7e65d152110d08add315cc1d5fbf7be61d68a4398cefe |
| hovercard-subject-tag | issue:382195240 |
| 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/5914/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b1f4247ef5fc1c4dc1d571afc01e36d919f829e1a09d65af86ea2c5a4c6e6848/python/mypy/issues/5914 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b1f4247ef5fc1c4dc1d571afc01e36d919f829e1a09d65af86ea2c5a4c6e6848/python/mypy/issues/5914 |
| og:image:alt | I run mypy on the following code, with no arguments other than the file name: class InnerBase: pass class OuterBase: class Inner(InnerBase): pass class OuterMixin: class Inner(InnerBase): pass clas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mthuurne |
| 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