@@ -431,28 +431,22 @@ def _str_header(self, name, symbol='-'):
431431 return [name , len (name )* symbol ]
432432
433433 def _str_indent (self , doc , indent = 4 ):
434- out = []
435- for line in doc :
436- out += [' ' * indent + line ]
437- return out
434+ return [' ' * indent + line for line in doc ]
438435
439436 def _str_signature (self ):
440437 if self ['Signature' ]:
441438 return [self ['Signature' ].replace ('*' , r'\*' )] + ['' ]
442- else :
443- return ['' ]
439+ return ['' ]
444440
445441 def _str_summary (self ):
446442 if self ['Summary' ]:
447443 return self ['Summary' ] + ['' ]
448- else :
449- return []
444+ return []
450445
451446 def _str_extended_summary (self ):
452447 if self ['Extended Summary' ]:
453448 return self ['Extended Summary' ] + ['' ]
454- else :
455- return []
449+ return []
456450
457451 def _str_param_list (self , name ):
458452 out = []
@@ -525,8 +519,7 @@ def _str_index(self):
525519 out += [' :%s: %s' % (section , ', ' .join (references ))]
526520 if output_index :
527521 return out
528- else :
529- return ''
522+ return ''
530523
531524 def __str__ (self , func_role = '' ):
532525 out = []
@@ -546,23 +539,11 @@ def __str__(self, func_role=''):
546539 return '\n ' .join (out )
547540
548541
549- def indent (str , indent = 4 ):
550- indent_str = ' ' * indent
551- if str is None :
552- return indent_str
553- lines = str .split ('\n ' )
554- return '\n ' .join (indent_str + l for l in lines )
555-
556-
557542def dedent_lines (lines ):
558543 """Deindent a list of lines maximally"""
559544 return textwrap .dedent ("\n " .join (lines )).split ("\n " )
560545
561546
562- def header (text , style = '-' ):
563- return text + '\n ' + style * len (text ) + '\n '
564-
565-
566547class FunctionDoc (NumpyDocString ):
567548 def __init__ (self , func , role = 'func' , doc = None , config = {}):
568549 self ._f = func
0 commit comments