【发布时间】:2016-01-19 17:09:15
【问题描述】:
我有一个参数设置为默认值的函数。我正在使用NumPy-style 文档字符串,但我在其他地方看到了默认值。在文档字符串中写“默认”的普遍接受的位置是什么?
def some_func(a_num=None, a_string=None):
''' A function that does something special.
Parameters
==========
a_num : int, default 100 # is it written here?
An important number.
a_string : str, default 'foo'
A useful string. Default is 'foo'. # or here?
'''
【问题讨论】: