Skip to content

False negative with multiple generic inheritance #22284

Closed as duplicate
Closed as duplicate

Description

@hauntsaninja

I would expect an error on the definition of Child (both ty and pyright emit one)

from typing import Generic, TypeVar
T = TypeVar('T')
class Base(Generic[T]):
    def get(self) -> T: ...
class Indirect(Base[int]): ...
class Child(Indirect, Base[str]): ...

Activity

  1. ilevkivskyi commented on Oct 24, 2026

    @ilevkivskyi
    Member

    I think this is a duplicate of #6184 (but feel free to re-open of you think it is different).

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 wrongtopic-inheritanceInheritance and incompatible overrides

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions