Since python 3.6 (or 3.4 ? I don't remember) we can annotate a function. Ex:
def getVersion() -> str:
Now what happens when a function returns a tuple ? We can do that:
def func() -> tuple:
But if we know the tuple is a tuple of two integers ? I read here: How to annotate types of multiple return values? that we can do that:
def func() -> Tuple[int, int]
But it requires to import the typing module.
Also I tried that:
def func() -> (int, int):
And it doesn't crash.
What is the right way ?