@@ -330,21 +330,27 @@ def _parse(self):
330330 if not section .startswith ('..' ):
331331 section = (s .capitalize () for s in section .split (' ' ))
332332 section = ' ' .join (section )
333- if self .get (section ):
334- msg = ("The section %s appears twice in the docstring." %
335- section )
336- raise ValueError (msg )
337333
338334 if section in ('Parameters' , 'Returns' , 'Yields' , 'Raises' ,
339335 'Warns' , 'Other Parameters' , 'Attributes' ,
340336 '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+
342341 elif section .startswith ('.. index::' ):
343342 self ['index' ] = self ._parse_index (section , content )
344343 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 ))
346347 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
348354
349355 # string conversion routines
350356
0 commit comments