小编Pie*_*ssé的帖子

Python 和 sphinx:多行 google 样式文档字符串中的项目符号列表

我目前正在使用 Sphinx 记录我的 Python 项目。在文档字符串的多行部分中包含项目符号列表时,我遇到了一个问题。

我想包括一个项目符号列表,但其中一项很长。我想要:

  • 通过 Sphinx 正确呈现项目符号列表
  • 但也有我的代码尊重 PEP8 关于行长度(<79)

你有什么建议让我为这个文档字符串做些什么:

class geography():
""" Class defining a geography (cities and distance matrix)

This class implements a geography with a list of named cities with their
associated coordinates in a plane. Helper functions enable to :

- give a visual representation of that geography
- give a visual representation of the distance matrix
- give a visual representation of a configuration, a configuration being the repartition of some or …
Run Code Online (Sandbox Code Playgroud)

python docstring google-style-guide python-sphinx

11
推荐指数
2
解决办法
5717
查看次数