我的函數(shù)接受一個(gè)參數(shù),該參數(shù)在內(nèi)部轉(zhuǎn)換為列表。foothingsdef foo(things):
things = list(things)
# more code構(gòu)造函數(shù)接受任何可迭代的。list但是,注釋 不會(huì)給用戶一個(gè)線索,即可迭代必須是有限的,而不是像 。thingstyping.Iterableitertools.count()在這種情況下,要使用的正確類(lèi)型提示是什么?
添加回答
舉報(bào)
0/150
提交
取消
