summaryrefslogtreecommitdiff
path: root/tests/examplefiles/python/switch_case.txt
blob: 36c34fbd346b3746e1751037df1a587f2585f4f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
match command.split():
    case ['to', direction] if direction in destination.route:
        return 1
    case 'foo' | 'bar':
        return 2
    case 'raz' as name:
        return 3
    case ['to', _]:
        return 4
    case else_bar:
        return 5
    case _:
        return 6

match command.split():
    case _Direction():
        return 1
    case _ as default:
        return 2

case = 1
match = 1
match if True else bar