Closed
Description
Currently, UnionType.make_simplified_union
will return an Any if any of the types passed in are Any. This probably doesn't make sense.
As a simple example, if we have:
def f(x: Union[str, Any]) -> int:
return x + 1
(This example looks a little silly, but this Any
might not be explicit -- it could e.g. be a class from a --silent-imports module.)
This is clearly unsafe. I think we should still require an isinstance check.