diff --git a/jmespath/visitor.py b/jmespath/visitor.py index 2c783e5e..31f16d8e 100644 --- a/jmespath/visitor.py +++ b/jmespath/visitor.py @@ -202,7 +202,7 @@ def visit_identity(self, node, value): def visit_index(self, node, value): # Even though we can index strings, we don't # want to support that. - if not isinstance(value, list): + if not isinstance(value, (list, tuple)): return None try: return value[node['value']] @@ -216,7 +216,7 @@ def visit_index_expression(self, node, value): return result def visit_slice(self, node, value): - if not isinstance(value, list): + if not isinstance(value, (list, tuple)): return None s = slice(*node['children']) return value[s]