Skip to content
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

typeddict check for multiple inheritance fails with type aliases #18692

Open
A5rocks opened this issue Feb 16, 2025 · 0 comments
Open

typeddict check for multiple inheritance fails with type aliases #18692

A5rocks opened this issue Feb 16, 2025 · 0 comments
Labels
bug mypy got something wrong topic-type-alias TypeAlias and other type alias issues topic-typed-dict

Comments

@A5rocks
Copy link
Collaborator

A5rocks commented Feb 16, 2025

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
@A5rocks A5rocks added bug mypy got something wrong topic-typed-dict topic-type-alias TypeAlias and other type alias issues labels Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-type-alias TypeAlias and other type alias issues topic-typed-dict
Projects
None yet
Development

No branches or pull requests

1 participant