code: def isinstance_(x, A_tuple):
      
      if is_union(A_tuple):
          return any(isinstance_(x, t) for t in A_tuple.__args__)
      elif getattr(A_tuple, '__origin__', None) is not None:
          return isinstance(x, A_tuple.__origin__)
      else:
          return isinstance(x, A_tuple)
docs: native isinstance_ with the test for typing.Union overridden