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
Just try each type in the Union until one of them works; re-raise the last exception if none do. Make a factory for this which takes in a Union annotation and returns a function that will try all of the types so that we can just assign that function as the type directly. Remember to change the function's __name__, though, so the error messages look better (have the name be the type annotation string, e.g. Union[int, bool]).
Activity