@@ -347,20 +347,27 @@ def _parse(self):
347347 if not section .startswith ('..' ):
348348 section = (s .capitalize () for s in section .split (' ' ))
349349 section = ' ' .join (section )
350- if self .get (section ):
351- self ._error_location ("The section %s appears twice"
352- % section )
353350
354351 if section in ('Parameters' , 'Returns' , 'Yields' , 'Raises' ,
355352 'Warns' , 'Other Parameters' , 'Attributes' ,
356353 'Methods' ):
357- self [section ] = self ._parse_param_list (content )
354+ existing_content = self .get (section , [])
355+ self [section ] = (existing_content +
356+ self ._parse_param_list (content ))
357+
358358 elif section .startswith ('.. index::' ):
359359 self ['index' ] = self ._parse_index (section , content )
360360 elif section == 'See Also' :
361- self ['See Also' ] = self ._parse_see_also (content )
361+ existing_content = self .get ('See Also' , [])
362+ self ['See Also' ] = (existing_content +
363+ self ._parse_see_also (content ))
362364 else :
363- self [section ] = content
365+ existing_content = self .get (section , [])
366+ if existing_content :
367+ existing_content += ['' ]
368+ else :
369+ existing_content = []
370+ self [section ] = existing_content + content
364371
365372 def _error_location (self , msg , error = True ):
366373 if hasattr (self , '_obj' ):
0 commit comments