parameter names can contain underscores

This commit is contained in:
Daniel Otto de Mentock 2022-11-28 10:33:07 +01:00
parent e10f9fa299
commit 8112f87d39
1 changed files with 2 additions and 2 deletions

View File

@ -567,7 +567,7 @@ def _docstringer(docstring: _Union[str, _Callable],
shift = min([len(line)-len(line.lstrip(' '))-indent for line in content])
extra = '\n'.join([(line[shift:] if shift > 0 else
f'{" "*-shift}{line}') for line in content])
docstring_ = _re.sub(fr'(^([ ]*){key}\s*\n\2{"-"*len(key)}[\n ]*[A-Za-z0-9 ]*: ([^\n]+\n)*)',
docstring_ = _re.sub(fr'(^([ ]*){key}\s*\n\2{"-"*len(key)}[\n ]*[A-Za-z0-9_ ]*: ([^\n]+\n)*)',
fr'\1{extra}\n',
docstring_,flags=_re.MULTILINE)
@ -583,7 +583,7 @@ def _docstringer(docstring: _Union[str, _Callable],
+(return_class.__name__ if not isinstance(return_class,str) else return_class)
)
return _re.sub(r'(^([ ]*)Returns\s*\n\2-------\s*\n[ ]*[A-Za-z0-9 ]*: )(.*)\n',
return _re.sub(r'(^([ ]*)Returns\s*\n\2-------\s*\n[ ]*[A-Za-z0-9_ ]*: )(.*)\n',
fr'\1{return_type_}\n',
docstring_,flags=_re.MULTILINE)