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