Skip to content

TypeVarTuple and ParamSpec allow too few arguments to be specified when used together #131696

@Viicos

Description

@Viicos

Bug report

Bug description:

Following #99344, it seems to me that the following should raise a TypeError:

class A[*Ts, **P]: ...


A[int]  # Should raise
A[int, str]  # Should raise (parameters for **P should be specified as [str], unless P was the only parameter).
 
class B[T, **P]: ...

B[int, str]  # Should also raise

I understand that these use cases may be really hard to support at runtime, if so I don't mind closing the issue.

CPython versions tested on:

3.14

Operating systems tested on:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-typingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions