Checks if arg is list-like. This excludes strings and dicts.
(arg)
| 155 | |
| 156 | |
| 157 | def _is_list(arg): |
| 158 | """Checks if arg is list-like. This excludes strings and dicts.""" |
| 159 | if isinstance(arg, dict): |
| 160 | return False |
| 161 | if isinstance(arg, str): # Python 3-only, as str has __iter__ |
| 162 | return False |
| 163 | return _has_method(arg, "__getitem__") if not _has_method(arg, "strip") else _has_method(arg, "__iter__") |
| 164 | |
| 165 | |
| 166 | def is_string(val): |
no test coverage detected