Is there a way to define the size of a tuple or list in the type hints of arguments?
At the moment I am using something like this:
from typing import List, Optional, Tuple
def function_name(self, list1: List[Class1]):
if len(list1) != 4:
raise SomeError()
pass
# some code here
I am searching for a leaner way to do this.