Python 中的 ->

Python 中的 -> 是什么意思

函数标注通常用于 类型提示:例如以下函数预期接受两个 int 参数并预期返回一个 int 值:
```
def sum_two_numbers(a: int, b: int) -> int:
return a + b

猜你喜欢

转载自blog.csdn.net/qq_42533216/article/details/121245239