'How to get Mypy to realize that sorting two ints gives back two ints

My code is as follows:

from typing import Tuple

a: Tuple[int, int] = tuple(sorted([1, 3]))

Mypy tells me:

Incompatible types in assignment (expression has type "Tuple[int, ...]", variable has type "Tuple[int, int]")

What am I doing wrong? Why can't Mypy figure out that the sorted tuple will give back exactly two integers?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source