KEMBAR78
typeddict check for multiple inheritance fails with type aliases · Issue #18692 · python/mypy · GitHub
Skip to content

typeddict check for multiple inheritance fails with type aliases #18692

@A5rocks

Description

@A5rocks

Bug Report

Mypy thinks a type alias isn't a typeddict.

To Reproduce

from typing import TypedDict, Unpack

class A(TypedDict, total=False):
    y: int
class B(TypedDict, total=False):
    x: str

D = B

class C(A, D):  # E: All bases of a new TypedDict must be TypedDict types  
    pass

Expected Behavior

no errors

Actual Behavior

main.py:10: error: All bases of a new TypedDict must be TypedDict types  [misc]
Found 1 error in 1 file (checked 1 source file)

Your Environment

Checked using mypy-play.

  • Mypy version used: 1.15
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions