You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def f(x):
# type: (object) -> list
if isinstance(x, (list, set)):
return [g(i) for i in x]
mypy will complain that an Iterable is expected (it still only sees x as an object). This can be resolved with e.g. a manual cast of x to Union[list, set], but this adds a slight overhead and isn't as clean.