-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working
Description
Describe the bug
In a match-case statement, a (*args,) capture pattern should match any tuple.
Similarly, (first, *args) and (*args, last) capture patterns should match any tuple with at least one element.
Code or Screenshots
def foo(x: tuple[object, *tuple[object, ...], object]) -> None:
match x: # Unhandled type: "tuple[object, *tuple[object, ...], object]"
case (*args,):
del args
match x: # Unhandled type: "tuple[object, *tuple[object, ...], object]"
case (*args, last):
del args, last
match x: # ok
case (first, *args, last):
del first, args, lastVS Code extension or command-line
Pylance 2025.9.1
Also tested with Pyright 1.1.407 on playground
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working