parent
16b6744345
commit
c8c872c512
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue