]> 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:

5c6985d0e0851cd71018a1ae7eb8b34d14891348
[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 believe_it_or_not_this_is_in_the_py_stdlib(): ''' 
106 "hey yah"'''
107
108
109 def ignored_docstring():
110     """a => \
111 b"""  
112
113
114 def docstring_with_inline_tabs_and_space_indentation():
115     """hey
116
117     tab separated       value
118         tab at start of line and then a tab     separated       value
119                                 multiple tabs at the beginning  and     inline
120                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
121                                                 
122     line ends with some tabs            
123     """
124
125
126 def docstring_with_inline_tabs_and_tab_indentation():
127         """hey
128
129         tab     separated       value
130                 tab at start of line and then a tab     separated       value
131                                         multiple tabs at the beginning  and     inline
132                                 mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
133                                                         
134         line ends with some tabs                
135         """
136         pass
137         
138
139 # output
140
141 class MyClass:
142     """Multiline
143     class docstring
144     """
145
146     def method(self):
147         """Multiline
148         method docstring
149         """
150         pass
151
152
153 def foo():
154     """This is a docstring with
155     some lines of text here
156     """
157     return
158
159
160 def bar():
161     """This is another docstring
162     with more lines of text
163     """
164     return
165
166
167 def baz():
168     '''"This" is a string with some
169     embedded "quotes"'''
170     return
171
172
173 def troz():
174     """Indentation with tabs
175     is just as OK
176     """
177     return
178
179
180 def zort():
181     """Another
182     multiline
183     docstring
184     """
185     pass
186
187
188 def poit():
189     """
190     Lorem ipsum dolor sit amet.
191
192     Consectetur adipiscing elit:
193      - sed do eiusmod tempor incididunt ut labore
194      - dolore magna aliqua
195        - enim ad minim veniam
196        - quis nostrud exercitation ullamco laboris nisi
197      - aliquip ex ea commodo consequat
198     """
199     pass
200
201
202 def under_indent():
203     """
204       These lines are indented in a way that does not
205     make sense.
206     """
207     pass
208
209
210 def over_indent():
211     """
212     This has a shallow indent
213       - But some lines are deeper
214       - And the closing quote is too deep
215     """
216     pass
217
218
219 def single_line():
220     """But with a newline after it!"""
221     pass
222
223
224 def this():
225     r"""
226     'hey ho'
227     """
228
229
230 def that():
231     """ "hey yah" """
232
233
234 def and_that():
235     """
236     "hey yah" """
237
238
239 def and_this():
240     '''
241     "hey yah"'''
242
243
244 def believe_it_or_not_this_is_in_the_py_stdlib():
245     '''
246     "hey yah"'''
247
248
249 def ignored_docstring():
250     """a => \
251 b"""
252
253
254 def docstring_with_inline_tabs_and_space_indentation():
255     """hey
256
257     tab separated       value
258         tab at start of line and then a tab     separated       value
259                                 multiple tabs at the beginning  and     inline
260                         mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
261
262     line ends with some tabs
263     """
264
265
266 def docstring_with_inline_tabs_and_tab_indentation():
267     """hey
268
269     tab separated       value
270             tab at start of line and then a tab separated       value
271                                     multiple tabs at the beginning      and     inline
272                             mixed tabs and spaces at beginning. next line has mixed tabs and spaces only.
273
274     line ends with some tabs
275     """
276     pass