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

As long as it's black (#1893)
[etc/vim.git] / tests / data / decorators.py
1 # This file doesn't use the standard decomposition.
2 # Decorator syntax test cases are separated by double # comments.
3 # Those before the 'output' comment are valid under the old syntax.
4 # Those after the 'ouput' comment require PEP614 relaxed syntax.
5 # Do not remove the double # separator before the first test case, it allows
6 # the comment before the test case to be ignored.
7
8 ##
9
10 @decorator
11 def f():
12     ...
13
14 ##
15
16 @decorator(arg)
17 def f():
18     ...
19     
20 ##
21
22 @decorator(kwarg=0)
23 def f():
24     ...
25
26 ##
27
28 @decorator(*args)
29 def f():
30     ...
31
32 ##
33
34 @decorator(**kwargs)
35 def f():
36     ...
37
38 ##
39
40 @decorator(*args, **kwargs)
41 def f():
42     ...
43
44 ##
45
46 @decorator(*args, **kwargs,)
47 def f():
48     ...
49
50 ##
51
52 @dotted.decorator
53 def f():
54     ...
55
56 ##
57
58 @dotted.decorator(arg)
59 def f():
60     ...
61     
62 ##
63
64 @dotted.decorator(kwarg=0)
65 def f():
66     ...
67
68 ##
69
70 @dotted.decorator(*args)
71 def f():
72     ...
73
74 ##
75
76 @dotted.decorator(**kwargs)
77 def f():
78     ...
79
80 ##
81
82 @dotted.decorator(*args, **kwargs)
83 def f():
84     ...
85
86 ##
87
88 @dotted.decorator(*args, **kwargs,)
89 def f():
90     ...
91
92 ##
93
94 @double.dotted.decorator
95 def f():
96     ...
97
98 ##
99
100 @double.dotted.decorator(arg)
101 def f():
102     ...
103     
104 ##
105
106 @double.dotted.decorator(kwarg=0)
107 def f():
108     ...
109
110 ##
111
112 @double.dotted.decorator(*args)
113 def f():
114     ...
115
116 ##
117
118 @double.dotted.decorator(**kwargs)
119 def f():
120     ...
121
122 ##
123
124 @double.dotted.decorator(*args, **kwargs)
125 def f():
126     ...
127
128 ##
129
130 @double.dotted.decorator(*args, **kwargs,)
131 def f():
132     ...
133
134 ##
135
136 @_(sequence["decorator"])
137 def f():
138     ...
139
140 ##
141
142 @eval("sequence['decorator']")
143 def f():
144     ...
145
146 # output
147
148 ##
149
150 @decorator()()
151 def f():
152     ...
153
154 ##
155
156 @(decorator)
157 def f():
158     ...
159
160 ##
161
162 @sequence["decorator"]
163 def f():
164     ...
165
166 ##
167
168 @decorator[List[str]]
169 def f():
170     ...
171
172 ##
173
174 @var := decorator
175 def f():
176     ...