]> git.madduck.net Git - etc/vim.git/blob - tests/data/preview_context_managers/auto_detect/features_3_10.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:

Run pyupgrade on blib2to3 and src (#3771)
[etc/vim.git] / tests / data / preview_context_managers / auto_detect / features_3_10.py
1 # This file uses pattern matching introduced in Python 3.10.
2
3
4 match http_code:
5     case 404:
6         print("Not found")
7
8
9 with \
10      make_context_manager1() as cm1, \
11      make_context_manager2() as cm2, \
12      make_context_manager3() as cm3, \
13      make_context_manager4() as cm4 \
14 :
15     pass
16
17
18 # output
19
20
21 # This file uses pattern matching introduced in Python 3.10.
22
23
24 match http_code:
25     case 404:
26         print("Not found")
27
28
29 with (
30     make_context_manager1() as cm1,
31     make_context_manager2() as cm2,
32     make_context_manager3() as cm3,
33     make_context_manager4() as cm4,
34 ):
35     pass