-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible definition of methods reported when using multiple inheritance #9319
Comments
This looks like a bug in type checking classes with multiple inheritance. You can use |
* add poetry dependency * create APIResponse model * return APIResponse model in execute method * sort imports * mypy bug workaround (python/mypy#9319) * split logic, validate error existance and better type APIResponse * Implement APIError * add missing black config in pre-commit config * type APIError properties * fix: rm unused code and use returning param in update * refactor: reorder lines * chore: rebuild sync * chore: rebuild poetry.lock * fix: remove wrong parameter * chore: format * Chore: add missing return types Co-authored-by: Anand <[email protected]> * chore: replace builtin dict by Dict to support python < 3.9 * chore: update precommit hooks * chore: apply format * update return type in execute method * use relative import * add link to mypy issue * switch super init by class init to avoid future errors * chore: apply future annotations notation to return * chore: rebuild sync * tests: Add tests for response model (#74) * initial commit * tests: add fixtures for APIResponse * tests: [WIP] Test methods that don't interact with RequestResponse * tests: replace builtin type by typing type and add type annotations * tests: add requests Response fixtures * chore: change return order to improve readability * tests: add tests for left methods Co-authored-by: Joel Lee <[email protected]> Co-authored-by: Dani Reinón <[email protected]> * chore: modify ValueError with ValidationError * chore: add "_" to internal methods Co-authored-by: Anand <[email protected]> Co-authored-by: Lee Yi Jie Joel <[email protected]> Co-authored-by: Joel Lee <[email protected]>
Is this related to this issue here? Is there any idea when a proper fix will be available? |
Is there any update on this? Alternatively to adding |
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:
Expected behaviour
mypy should print
Actual behaviour
mypy prints three error messages:
Comments
The error messages go away when
class D(enum.IntFlag)
instead ofclass D(C, enum.IntFlag)
.enum.Flag
instead ofenum.IntFlag
The text was updated successfully, but these errors were encountered: