"SupportsInt" doesn't work with Union types
The following shouldn't be an error:
error: Argument 1 to "int" has incompatible type "Union[unicode, int]"; expected "SupportsInt"
In particular, you can repro this for Python 2 with:
from typing import Union
x = 0 # type: Union[int, unicode]
int(x)
I would guess it is another example of #2128 and the general overloading/Union problem.
FYI this is still an issue in Python 3.6:
error: Argument 1 to "int" has incompatible type "Union[int, str]"; expected "SupportsInt"
Yes, this is an issue in mypy's union deduction checks, and is independent of Python version.
This issue is now fixed (example correctly passes).