相关疑难解决方法(0)

使用List/Tuple/etc.从输入vs直接引用类型为list/tuple/etc.

什么是使用的差异List,Tuple等等.从typing模块:

from typing import Tuple

def f(points: Tuple):
    return map(do_stuff, points)
Run Code Online (Sandbox Code Playgroud)

而不是直接引用Python的类型:

def f(points: tuple):
    return map(do_stuff, points)
Run Code Online (Sandbox Code Playgroud)

我何时应该使用另一个?

python typing type-hinting python-3.5

30
推荐指数
3
解决办法
8059
查看次数

标签 统计

python ×1

python-3.5 ×1

type-hinting ×1

typing ×1