]> git.madduck.net Git - etc/vim.git/blob - tests/data/py_310/pattern_matching_style.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Bump pypa/cibuildwheel from 2.10.2 to 2.11.2 (#3367)
[etc/vim.git] / tests / data / py_310 / pattern_matching_style.py
1 match something:
2     case b(): print(1+1)
3     case c(
4         very_complex=True,
5         perhaps_even_loooooooooooooooooooooooooooooooooooooong=-   1
6     ): print(1)
7     case c(
8         very_complex=True,
9         perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1,
10     ): print(2)
11     case a: pass
12
13 match(
14     arg # comment
15 )
16
17 match(
18 )
19
20 match(
21
22
23 )
24
25 case(
26     arg # comment
27 )
28
29 case(
30 )
31
32 case(
33
34
35 )
36
37
38 re.match(
39     something # fast
40 )
41 re.match(
42
43
44
45 )
46 match match(
47
48
49 ):
50     case case(
51         arg, # comment
52     ):
53         pass
54
55 # output
56
57 match something:
58     case b():
59         print(1 + 1)
60     case c(
61         very_complex=True, perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1
62     ):
63         print(1)
64     case c(
65         very_complex=True,
66         perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1,
67     ):
68         print(2)
69     case a:
70         pass
71
72 match(arg)  # comment
73
74 match()
75
76 match()
77
78 case(arg)  # comment
79
80 case()
81
82 case()
83
84
85 re.match(something)  # fast
86 re.match()
87 match match():
88     case case(
89         arg,  # comment
90     ):
91         pass