python - rtype在Python中是什么意思?

标签 python python-sphinx

当我做一些代码测试时,在解决方案函数下面有一些评论是这样的:

"""
:type x: int
:rtype: int
"""

x 是我唯一的输入,那么 rtype 代表什么?

最佳答案

为避免混淆:

type:    Type of a parameter.
vartype: Type of a variable. 
rtype:   Return type. 

关于python - rtype在Python中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51651561/

相关文章:

python - Sphinx 文档,带编号的图形引用

具有轻量级标记的 Javascript API 文档框架

python - 使用 Sphinx 自动记录 Python

python - 为自定义指令的节点生成标签

python - 如何使用生成器参数验证 Python 模拟调用

python - python 中 timeit.timeit() 函数的拆解

python - 将嵌套的 html 表转换为 python 中的嵌套字典?

python - 如何检索页面数据作为输入并为用户提供自定义输出?

python - 如何使用 Python 通过 HTTP 从远程 Zip 存档中读取选定的文件?

lua - lua过滤器迭代表行的问题