【发布时间】:2015-02-26 22:14:53
【问题描述】:
我想指定 Pydoc 记录我的函数的顺序。我不确定 Pydoc 如何对生成的文档中的函数进行排序——这肯定不是模块中的文本顺序。
这很有用,因为我想指定我的 printUsage() 函数首先被记录。
"""
Sample module docstring
"""
def printUsage():
"""
Command line usage: python my_module.py -i path/to/input_file.c
If calling my_function() directly, pass the path/to/input_file.c as an arg.
"""
print(printUsage.__doc__)
...
这样当用户签出my_module 的文档字符串时,他可以快速了解如何使用它。
【问题讨论】: