def foo() -> int: # foo 的返回值为int类
a: str # a的类型为str
def sum_test(a: int, b: int) -> int: return a + b
调用函数时,将自动提示,所需的参数类型
京公网安备 11010502049817号