Skip to content

function

类型注解

3.5引入的新特性,允许你可以明确指定参数的类型和返回值

python
def add(a: int, b: int) -> int:
    return a + b