My function foo
accepts an argument things
which is turned into a list internally.
def foo(things):
things = list(things)
# more code
The list
constructor accepts any iterable.
However, annotating things
with typing.Iterable
does not give the user a clue that the iterable must be finite, not something like itertools.count()
.
What's the correct type hint to use in this case?