Title: Incompatible definition of methods reported when using multiple inheritance · Issue #9319 · python/mypy · GitHub
Open Graph Title: Incompatible definition of methods reported when using multiple inheritance · Issue #9319 · python/mypy
X Title: Incompatible definition of methods reported when using multiple inheritance · Issue #9319 · python/mypy
Description: Using mypy 0.782, errors about incompatible method redefinitions are issued -- but only if multiple inheritance is in play. How to Reproduce Run mypy (without any arguments) on this script: import enum class C: pass class D(C, enum.IntFl...
Open Graph Description: Using mypy 0.782, errors about incompatible method redefinitions are issued -- but only if multiple inheritance is in play. How to Reproduce Run mypy (without any arguments) on this script: import ...
X Description: Using mypy 0.782, errors about incompatible method redefinitions are issued -- but only if multiple inheritance is in play. How to Reproduce Run mypy (without any arguments) on this script: import ...
Opengraph URL: https://github.com/python/mypy/issues/9319
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incompatible definition of methods reported when using multiple inheritance","articleBody":"Using mypy 0.782, errors about incompatible method redefinitions are issued -- but only if multiple inheritance is in play.\r\n\r\n## How to Reproduce\r\n\r\nRun mypy (without any arguments) on this script:\r\n\r\n```python\r\nimport enum\r\n\r\nclass C:\r\n pass\r\n\r\nclass D(C, enum.IntFlag):\r\n pass\r\n```\r\n\r\n## Expected behaviour\r\nmypy should print\r\n\r\n```\r\nSuccess: no issues found in 1 source file\r\n```\r\n\r\n## Actual behaviour\r\nmypy prints three error messages:\r\n\r\n```\r\nmypy-error.py:6: error: Definition of \"__xor__\" in base class \"int\" is incompatible with definition in base class \"Flag\"\r\nmypy-error.py:6: error: Definition of \"__or__\" in base class \"int\" is incompatible with definition in base class \"Flag\"\r\nmypy-error.py:6: error: Definition of \"__and__\" in base class \"int\" is incompatible with definition in base class \"Flag\"\r\nFound 3 errors in 1 file (checked 1 source file)\r\n```\r\n\r\n### Comments\r\n\r\nThe error messages go away when\r\n\r\n* Not using multiple inheritance, i.e. `class D(enum.IntFlag)` instead of `class D(C, enum.IntFlag)`.\r\n* Or: when using `enum.Flag` instead of `enum.IntFlag`\r\n","author":{"url":"https://github.com/frerich","@type":"Person","name":"frerich"},"datePublished":"2020-08-17T12:41:41Z","url":"https://github.com/python/mypy/issues/9319"}
| 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:7b45e14d-e94c-34bb-2f30-aa9a407893a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DD46:295E45:204976:2D3E86:6B0057F2 |
| html-safe-nonce | f64efcf3a739b16de9ba804b02a6194fba1af5b4d571c5d304da6f21808a2c0c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDQ2OjI5NUU0NToyMDQ5NzY6MkQzRTg2OjZCMDA1N0YyIiwidmlzaXRvcl9pZCI6IjE4NjMxOTQ4MjA5NjU1ODY5MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0ec8844a30b38c6704b3b3b16d626e819e63d6f0187e49e4692fc827dce6ee74 |
| hovercard-subject-tag | issue:680205499 |
| 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/9319/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e33e62ef0e843759efbc8b6a98ee5b0132b365a45412322b507500f7014bb316/python/mypy/issues/9319 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e33e62ef0e843759efbc8b6a98ee5b0132b365a45412322b507500f7014bb316/python/mypy/issues/9319 |
| og:image:alt | Using mypy 0.782, errors about incompatible method redefinitions are issued -- but only if multiple inheritance is in play. How to Reproduce Run mypy (without any arguments) on this script: import ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | frerich |
| 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