Skip to content

Unpack generic tuple with no args not working #19140

Closed
@herobank110

Description

@herobank110

Bug Report

I would like a generic class with TypeVarTuple and connect a callback as parameter to a member function. This works for instances of the object created with one or more type arguments, but fails for no types.

To Reproduce

https://mypy-play.net/?mypy=latest&python=3.13&gist=9176cff57ec791ec0bd9d49e17b1e85e

Expected Behavior

Mypy should allow unpacking the TypeVarTuple to a Callable with no arguments.

Actual Behavior

error: Argument 1 to "foo" of "Class" has incompatible type "Callable[[], None]"; expected "Callable[[VarArg(Never)], None]" [arg-type]

Your Environment

mypy playground

  • Mypy version used: 1.15.0
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions