Skip to content

Reject incompatible baseclass definitions #241

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

Closed
JukkaL opened this issue Jul 15, 2013 · 2 comments
Closed

Reject incompatible baseclass definitions #241

JukkaL opened this issue Jul 15, 2013 · 2 comments
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 15, 2013

When using multiple inheritance, the type checker does not complain if base classes have incompatible definitions. For example, this is not rejected:

import typing
class A:
    def f(self, x: int) -> None: pass
class B:
    def f(self, x: str) -> None: pass
class C(A, B): pass # No error, but should complain about f

Verify that all inherited definitions are compatible.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 15, 2013

Related test case: testMethodNameCollisionInMultipleInheritanceWithIncompatibleSigs-skip in check-multiple-inheritance.test.

@JukkaL JukkaL removed the front end label Jul 25, 2014
@JukkaL
Copy link
Collaborator Author

JukkaL commented Apr 26, 2016

Mypy now complains about this -- seems to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

1 participant