empty-docstring (D419) 源自 pydocstyle 代码检查器。 作用 检查空文档字符串。 为什么这不好? 空文档字符串表明文档不完整。应该将其删除或替换为有意义的文档字符串。 示例 def average(values: list[float]) -> float: """""" 建议改为 def average(values: list[float]) -> float: """Return the mean of the given values.""" 参考 PEP 257 – 文档字符串约定 NumPy 风格指南 Google Python 风格指南 - 文档字符串