什么是使用的差异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)
我何时应该使用另一个?