Reputation: 12627
What type hint should I use in Python 3 to describe an argument that I will use in these 3 ways:
if len(arg):
...for item in arg:
...if item in arg:
...Upvotes: 7
Views: 1812
Reputation: 12627
You may use collections.abc.Collection
from collections.abc import Collection
def fn(arg: Collection[int]):
pass
Upvotes: 4