code: def _is_list(arg):
      
      if isinstance(arg, dict):
          return False
      if isinstance(arg, str): # Python 3-only, as str has __iter__
          return False
      return (not _has_method(arg, "strip")
              and _has_method(arg, "__getitem__")
              or _has_method(arg, "__iter__"))
docs: Checks if arg is list-like. This excludes strings and dicts.