Check if val is not a list, but is a collections.Iterable type. This is used to determine when list() should be called on val >>> l = [1, 2] >>> is_iterable(l) False >>> is_iterable(iter(l)) True :param val: value to check :return: True if it is not a list, but
(val)
| 68 | |
| 69 | |
| 70 | def is_iterable(val): |
| 71 | """ |
| 72 | Check if val is not a list, but is a collections.Iterable type. This is used to determine |
| 73 | when list() should be called on val |
| 74 | |
| 75 | >>> l = [1, 2] |
| 76 | >>> is_iterable(l) |
| 77 | False |
| 78 | >>> is_iterable(iter(l)) |
| 79 | True |
| 80 | |
| 81 | :param val: value to check |
| 82 | :return: True if it is not a list, but is a collections.Iterable |
| 83 | """ |
| 84 | if isinstance(val, list): |
| 85 | return False |
| 86 | return isinstance(val, collections.abc.Iterable) |
| 87 | |
| 88 | |
| 89 | def is_tabulatable(val): |
no outgoing calls