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

Fix feature detection for positional-only arguments in lambdas (#2532)
[etc/vim.git] / tests / data / docstring.py
1 class MyClass:
2   """ Multiline
3   class docstring
4   """
5
6   def method(self):
7     """Multiline
8     method docstring
9     """
10     pass
11
12
13 def foo():
14   """This is a docstring with             
15   some lines of text here
16   """
17   return
18
19
20 def bar():
21   '''This is another docstring
22   with more lines of text
23   '''
24   return
25
26
27 def baz():
28   '''"This" is a string with some
29   embedded "quotes"'''
30   return
31
32
33 def troz():
34         '''Indentation with tabs
35         is just as OK
36         '''
37         return
38
39
40 def zort():
41         """Another
42         multiline
43         docstring
44         """
45         pass
46
47 def poit():
48   """
49   Lorem ipsum dolor sit amet.       
50
51   Consectetur adipiscing elit:
52    - sed do eiusmod tempor incididunt ut labore
53    - dolore magna aliqua
54      - enim ad minim veniam
55      - quis nostrud exercitation ullamco laboris nisi
56    - aliquip ex ea commodo consequat
57   """
58   pass
59
60
61 def under_indent():
62   """
63   These lines are indented in a way that does not
64 make sense.
65   """
66   pass
67
68
69 def over_indent():
70   """
71   This has a shallow indent
72     - But some lines are deeper
73     - And the closing quote is too deep
74     """
75   pass
76
77
78 def single_line():
79     """But with a newline after it!
80
81     """
82     pass
83
84
85 def this():
86     r"""
87     'hey ho'
88     """
89
90
91 def that():
92   """ "hey yah" """
93
94
95 def and_that():
96   """
97   "hey yah" """
98
99
100 def and_this():
101   ''' 
102   "hey yah"'''
103
104
105 def multiline_whitespace():
106     '''
107     
108     
109     
110     
111     '''
112
113
114 def oneline_whitespace():
115     '''      '''
116
117
118 def empty():
119     """"""
120
121
122 def single_quotes():
123     'testing'
124
125
126 def believe_it_or_not_this_is_in_the_py_stdlib(): ''' 
127 "hey yah"'''
128
129
130 def ignored_docstring():
131     """a => \
132 b"""  
133
134 def single_line_docstring_with_whitespace():
135     """   This should be stripped """
136
137 def docstring_with_inline_tabs_and_space_indentation():
138     """hey
139
140     tab separated       value
141         tab at start of line and then a tab     separated       value
142                                 multiple tabs at the beginning  and     inline
143                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
144                                                 
145     line ends with some tabs            
146     """
147
148
149 def docstring_with_inline_tabs_and_tab_indentation():
150         """hey
151
152         tab     separated       value
153                 tab at start of line and then a tab     separated       value
154                                         multiple tabs at the beginning  and     inline
155                                 mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
156                                                         
157         line ends with some tabs                
158         """
159         pass
160
161
162 def backslash_space():
163     """\ """
164
165
166 def multiline_backslash_1():
167   '''
168   hey\there\
169   \ '''
170
171
172 def multiline_backslash_2():
173   '''
174   hey there \ '''
175
176
177 def multiline_backslash_3():
178   '''
179   already escaped \\ '''
180
181
182 def my_god_its_full_of_stars_1():
183     "I'm sorry Dave\u2001"
184
185
186 # the space below is actually a \u2001, removed in output
187 def my_god_its_full_of_stars_2():
188     "I'm sorry Dave "
189
190
191 # output
192
193 class MyClass:
194     """Multiline
195     class docstring
196     """
197
198     def method(self):
199         """Multiline
200         method docstring
201         """
202         pass
203
204
205 def foo():
206     """This is a docstring with
207     some lines of text here
208     """
209     return
210
211
212 def bar():
213     """This is another docstring
214     with more lines of text
215     """
216     return
217
218
219 def baz():
220     '''"This" is a string with some
221     embedded "quotes"'''
222     return
223
224
225 def troz():
226     """Indentation with tabs
227     is just as OK
228     """
229     return
230
231
232 def zort():
233     """Another
234     multiline
235     docstring
236     """
237     pass
238
239
240 def poit():
241     """
242     Lorem ipsum dolor sit amet.
243
244     Consectetur adipiscing elit:
245      - sed do eiusmod tempor incididunt ut labore
246      - dolore magna aliqua
247        - enim ad minim veniam
248        - quis nostrud exercitation ullamco laboris nisi
249      - aliquip ex ea commodo consequat
250     """
251     pass
252
253
254 def under_indent():
255     """
256       These lines are indented in a way that does not
257     make sense.
258     """
259     pass
260
261
262 def over_indent():
263     """
264     This has a shallow indent
265       - But some lines are deeper
266       - And the closing quote is too deep
267     """
268     pass
269
270
271 def single_line():
272     """But with a newline after it!"""
273     pass
274
275
276 def this():
277     r"""
278     'hey ho'
279     """
280
281
282 def that():
283     """ "hey yah" """
284
285
286 def and_that():
287     """
288     "hey yah" """
289
290
291 def and_this():
292     '''
293     "hey yah"'''
294
295
296 def multiline_whitespace():
297     """ """
298
299
300 def oneline_whitespace():
301     """ """
302
303
304 def empty():
305     """"""
306
307
308 def single_quotes():
309     "testing"
310
311
312 def believe_it_or_not_this_is_in_the_py_stdlib():
313     '''
314     "hey yah"'''
315
316
317 def ignored_docstring():
318     """a => \
319 b"""
320
321
322 def single_line_docstring_with_whitespace():
323     """This should be stripped"""
324
325
326 def docstring_with_inline_tabs_and_space_indentation():
327     """hey
328
329     tab separated       value
330         tab at start of line and then a tab     separated       value
331                                 multiple tabs at the beginning  and     inline
332                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
333
334     line ends with some tabs
335     """
336
337
338 def docstring_with_inline_tabs_and_tab_indentation():
339     """hey
340
341     tab separated       value
342             tab at start of line and then a tab separated       value
343                                     multiple tabs at the beginning      and     inline
344                             mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
345
346     line ends with some tabs
347     """
348     pass
349
350
351 def backslash_space():
352     """\ """
353
354
355 def multiline_backslash_1():
356     """
357   hey\there\
358   \ """
359
360
361 def multiline_backslash_2():
362     """
363     hey there \ """
364
365
366 def multiline_backslash_3():
367     """
368     already escaped \\"""
369
370
371 def my_god_its_full_of_stars_1():
372     "I'm sorry Dave\u2001"
373
374
375 # the space below is actually a \u2001, removed in output
376 def my_god_its_full_of_stars_2():
377     "I'm sorry Dave"