black/tests/data/py_310/pattern_matching_style.py
2022-05-18 12:11:37 -07:00

92 lines
1.0 KiB
Python

match something:
case b(): print(1+1)
case c(
very_complex=True,
perhaps_even_loooooooooooooooooooooooooooooooooooooong=- 1
): print(1)
case c(
very_complex=True,
perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1,
): print(2)
case a: pass
match(
arg # comment
)
match(
)
match(
)
case(
arg # comment
)
case(
)
case(
)
re.match(
something # fast
)
re.match(
)
match match(
):
case case(
arg, # comment
):
pass
# output
match something:
case b():
print(1 + 1)
case c(
very_complex=True, perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1
):
print(1)
case c(
very_complex=True,
perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1,
):
print(2)
case a:
pass
match(arg) # comment
match()
match()
case(arg) # comment
case()
case()
re.match(something) # fast
re.match()
match match():
case case(
arg, # comment
):
pass