Skip to content

Reject incompatible baseclass definitions #241

Closed

Description

@JukkaL

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.

Activity

  1. JukkaL commented on Jul 15, 2013

    @JukkaL
    CollaboratorAuthor

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

  2. JukkaL commented on Apr 26, 2016

    @JukkaL
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions