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

add FAQ entry about undetected syntax errors (#2645)
[etc/vim.git] / tests / data / pep_572_remove_parens.py
1 if (foo := 0):
2     pass
3
4 if (foo := 1):
5     pass
6
7 if (y := 5 + 5):
8     pass
9
10 y = (x := 0)
11
12 y += (x := 0)
13
14 (y := 5 + 5)
15
16 test: int = (test2 := 2)
17
18 a, b = (test := (1, 2))
19
20 # see also https://github.com/psf/black/issues/2139
21 assert (foo := 42 - 12)
22
23 foo(x=(y := f(x)))
24
25
26 def foo(answer=(p := 42)):
27     ...
28
29
30 def foo2(answer: (p := 42) = 5):
31     ...
32
33
34 lambda: (x := 1)
35
36 a[(x := 12)]
37 a[:(x := 13)]
38
39 # we don't touch expressions in f-strings but if we do one day, don't break 'em
40 f'{(x:=10)}'
41
42
43 def a():
44     return (x := 3)
45     await (b := 1)
46     yield (a := 2)
47     raise (c := 3)
48
49 def this_is_so_dumb() -> (please := no):
50     pass
51
52
53 # output
54 if foo := 0:
55     pass
56
57 if foo := 1:
58     pass
59
60 if y := 5 + 5:
61     pass
62
63 y = (x := 0)
64
65 y += (x := 0)
66
67 (y := 5 + 5)
68
69 test: int = (test2 := 2)
70
71 a, b = (test := (1, 2))
72
73 # see also https://github.com/psf/black/issues/2139
74 assert (foo := 42 - 12)
75
76 foo(x=(y := f(x)))
77
78
79 def foo(answer=(p := 42)):
80     ...
81
82
83 def foo2(answer: (p := 42) = 5):
84     ...
85
86
87 lambda: (x := 1)
88
89 a[(x := 12)]
90 a[:(x := 13)]
91
92 # we don't touch expressions in f-strings but if we do one day, don't break 'em
93 f"{(x:=10)}"
94
95
96 def a():
97     return (x := 3)
98     await (b := 1)
99     yield (a := 2)
100     raise (c := 3)
101
102
103 def this_is_so_dumb() -> (please := no):
104     pass
105