blank-line-after-function (D202)
源自 pydocstyle 代码检查器。
有时提供修复。
作用
检查函数上的文档字符串是否与函数体之间用一个或多个空行分隔。
为什么这不好?
删除函数体和函数文档字符串之间的任何空行,以保持一致性。
示例
def average(values: list[float]) -> float:
"""Return the mean of the given values."""
return sum(values) / len(values)
建议改为
def average(values: list[float]) -> float:
"""Return the mean of the given values."""
return sum(values) / len(values)