PEP 622: Fix example in static checks

Fixes #1516
This commit is contained in:
Guido van Rossum 2020-07-09 14:51:09 -07:00
parent 16b6744345
commit c8c872c512
1 changed files with 2 additions and 2 deletions

View File

@ -990,10 +990,10 @@ expression with a union type::
def classify(val: Union[int, Tuple[int, int], List[int]]) -> str:
match val:
case [x, *other]:
return f"A sequence starting with {x}"
case [x, y] if x > 0 and y > 0:
return f"A pair of {x} and {y}"
case [x, *other]:
return f"A sequence starting with {x}"
case int():
return f"Some integer"
# Type-checking error: some cases unhandled.