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

 

 

参考:

https://www.v2ex.com/t/524374

相关文章:

  • 2021-04-15
  • 2021-07-06
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2021-09-23
猜你喜欢
  • 2021-05-07
  • 2021-09-27
  • 2021-10-28
  • 2021-09-14
  • 2021-07-05
相关资源
相似解决方案