问题描述:

I have the following docstring:

def progress_bar(progress, length=20):

'''

Returns a textual progress bar.

>>> progress_bar(0.6)

'[##########--------]'

:param progress: Number between 0 and 1 describes the progress.

:type progress: float

:param length: The length of the progress bar in chars. Default is 20.

:type length: int

:rtype: string

'''

Is there a way to tell sphinx to add the "Default is X" part to the parameters' description if available?

网友答案:

This is not possible and must be done manually.

相关阅读:
Top