@@ -330,21 +330,27 @@ def _parse(self):
330
330
if not section .startswith ('..' ):
331
331
section = (s .capitalize () for s in section .split (' ' ))
332
332
section = ' ' .join (section )
333
- if self .get (section ):
334
- msg = ("The section %s appears twice in the docstring." %
335
- section )
336
- raise ValueError (msg )
337
333
338
334
if section in ('Parameters' , 'Returns' , 'Yields' , 'Raises' ,
339
335
'Warns' , 'Other Parameters' , 'Attributes' ,
340
336
'Methods' ):
341
- self [section ] = self ._parse_param_list (content )
337
+ existing_content = self .get (section , [])
338
+ self [section ] = (existing_content +
339
+ self ._parse_param_list (content ))
340
+
342
341
elif section .startswith ('.. index::' ):
343
342
self ['index' ] = self ._parse_index (section , content )
344
343
elif section == 'See Also' :
345
- self ['See Also' ] = self ._parse_see_also (content )
344
+ existing_content = self .get ('See Also' , [])
345
+ self ['See Also' ] = (existing_content +
346
+ self ._parse_see_also (content ))
346
347
else :
347
- self [section ] = content
348
+ existing_content = self .get (section , [])
349
+ if existing_content :
350
+ existing_content += ['' ]
351
+ else :
352
+ existing_content = []
353
+ self [section ] = existing_content + content
348
354
349
355
# string conversion routines
350
356
0 commit comments