最佳答案
使用List
、Tuple
等有什么区别?从typing
模块:
from typing import Tuple
def f(points: Tuple):
return map(do_stuff, points)
而不是直接引用Python的类型:
def f(points: tuple):
return map(do_stuff, points)
什么时候我应该使用一个而不是另一个?