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

Make context manager examples in future style docs consistent (#3274)
[etc/vim.git] / tests / data / preview / skip_magic_trailing_comma.py
1 # We should not remove the trailing comma in a single-element subscript.
2 a: tuple[int,]
3 b = tuple[int,]
4
5 # But commas in multiple element subscripts should be removed.
6 c: tuple[int, int,]
7 d = tuple[int, int,]
8
9 # Remove commas for non-subscripts.
10 small_list = [1,]
11 list_of_types = [tuple[int,],]
12 small_set = {1,}
13 set_of_types = {tuple[int,],}
14
15 # Except single element tuples
16 small_tuple = (1,)
17
18 # output
19 # We should not remove the trailing comma in a single-element subscript.
20 a: tuple[int,]
21 b = tuple[int,]
22
23 # But commas in multiple element subscripts should be removed.
24 c: tuple[int, int]
25 d = tuple[int, int]
26
27 # Remove commas for non-subscripts.
28 small_list = [1]
29 list_of_types = [tuple[int,]]
30 small_set = {1}
31 set_of_types = {tuple[int,]}
32
33 # Except single element tuples
34 small_tuple = (1,)