def parse_docstring(s):
title = []
description = []
strings = inspect.cleandoc(s).split("\n")
for i, x in enumerate(strings):
if x:
title.append(x)
else:
if title:
description = strings[i + 1:]
break
else:
continue
return {
"title": " ".join(title),
"description": " ".join(description)
}
评论列表
文章目录