我有一个模块 errors.py
,其中定义了几个全局常量(注意: 我知道 Python 没有常量,但是我使用 UPPERCASE 通过约定定义了它们)。
"""Indicates some unknown error."""
API_ERROR = 1
"""Indicates that the request was bad in some way."""
BAD_REQUEST = 2
"""Indicates that the request is missing required parameters."""
MISSING_PARAMS = 3
使用 ReStructuredText 如何记录这些常数?正如您所看到的,我在它们上面列出了一个 docstring,但是我没有找到任何指示这样做的文档,我只是猜测一下。