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

mypy doesn't know about empty unpacked tuples #18390

Open
A5rocks opened this issue Dec 31, 2024 · 0 comments · May be fixed by #18395
Open

mypy doesn't know about empty unpacked tuples #18390

A5rocks opened this issue Dec 31, 2024 · 0 comments · May be fixed by #18395
Labels
bug mypy got something wrong topic-pep-646 PEP 646 (TypeVarTuple, Unpack)

Comments

@A5rocks
Copy link
Contributor

A5rocks commented Dec 31, 2024

Bug Report

Blah[()] works sometimes when Blah[Unpack[tuple[()]]] doesn't and that doesn't make sense.

To Reproduce

from typing import Generic, TypeVarTuple, Unpack

Ts = TypeVarTuple("Ts")

class Blah(Generic[Unpack[Ts]]):
    pass

x: Blah[()]  # works
y: Blah[Unpack[tuple[()]]]  # E: Missing type parameters for generic type "Blah[()]"

Expected Behavior

Both should work.

Actual Behavior

Only first works.

Your Environment

Checked on mypy playground.

  • Mypy version used: v1.14
  • Mypy command-line flags: strict
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.12
@A5rocks A5rocks added the bug mypy got something wrong label Dec 31, 2024
@AlexWaygood AlexWaygood added the topic-pep-646 PEP 646 (TypeVarTuple, Unpack) label Dec 31, 2024
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-pep-646 PEP 646 (TypeVarTuple, Unpack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants