Skip to content

mypy doesn't know about empty unpacked tuples #18390

Closed

Description

@A5rocks

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

Activity

  1. added
    bug
    on Dec 31, 2024
  2. added
    topic-pep-646
    on Dec 31, 2024
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

    bugtopic-pep-646

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions