当我做一些代码测试时,解决方案函数下面有一些注释,如下所示:
"""
:type x: int
:rtype: int
"""
x
是我唯一的输入,那么rtype代表什么呢?
发布于 2018-08-10 04:46:11
要避免混淆,请执行以下操作:
type: Type of a parameter.
vartype: Type of a variable.
rtype: Return type.
发布于 2018-08-02 18:43:20
它是“返回类型”的缩写。
有关字段名称和示例的详细信息,请参阅Sphinx documentation。
https://stackoverflow.com/questions/51651561
复制相似问题