相关疑难解决方法(0)

打字.任何vs对象?

使用typing.Anyobject打字相比有什么区别吗?例如:

def get_item(L: list, i: int) -> typing.Any:
    return L[i]
Run Code Online (Sandbox Code Playgroud)

相比:

def get_item(L: list, i: int) -> object:
    return L[i]
Run Code Online (Sandbox Code Playgroud)

python type-hinting python-3.5

21
推荐指数
2
解决办法
4332
查看次数

标签 统计

python ×1

python-3.5 ×1

type-hinting ×1