使用重组 text/Sphinx 记录时如何在声明中包含参数类型?
How to include the type of a parameter with its declaration when documenting with restructured text/Sphinx?
我熟悉使用 2 行记录 Python 函数的参数,如下所示:
def get_market_history(self, market, count):
"""
Used to retrieve the latest trades that have occured for a
specific market.
/market/getmarkethistory
:param market: String literal for the market (ex: BTC-LTC)
:type market: str
但据我了解,对于简单类型,您可以将类型包含在 :param
行中,因此只需要一行而不是两行。但我忘记了它的语法,希望能举个例子。
:param str sender: The person sending the message
来自 documentation
我熟悉使用 2 行记录 Python 函数的参数,如下所示:
def get_market_history(self, market, count):
"""
Used to retrieve the latest trades that have occured for a
specific market.
/market/getmarkethistory
:param market: String literal for the market (ex: BTC-LTC)
:type market: str
但据我了解,对于简单类型,您可以将类型包含在 :param
行中,因此只需要一行而不是两行。但我忘记了它的语法,希望能举个例子。
:param str sender: The person sending the message
来自 documentation