union_any.py:
fromtypingimportAny, Uniondeffunc(v):
# type: (Union[int, Any]) -> strifisinstance(v, int):
s=hex(v)
else:
s=str(v).lower()
return"key:"+s
mypy union_any.py:
union_any.py: note: In function "func":
union_any.py:8: error: No overload variant of "str" matches argument types [Union[<ERROR>, void]]
mypy --py2 union_any.py:
union_any.py: note: In function "func":
union_any.py:8: error: Argument 1 to "str" has incompatible type "Union[object, None]"; expected "object"
I discovered this when I used a class which was defined in some library which did not have stubs and I was using --silent-imports.
union_any.py:mypy union_any.py:mypy --py2 union_any.py:I discovered this when I used a class which was defined in some library which did not have stubs and I was using
--silent-imports.