diff --git a/lark/tree.py b/lark/tree.py
index <HASH>..<HASH> 100644
--- a/lark/tree.py
+++ b/lark/tree.py
@@ -110,9 +110,9 @@ class Tree(object):
     def expand_kids_by_data(self, *data_values):
         """Expand (inline) children with any of the given data values. Returns True if anything changed"""
         changed = False
-        for i, c in reversed(list(enumerate(self.children))):
-            if isinstance(c, Tree) and c.data in data_values:
-                child = self.children[i]
+        for i in range(len(self.children)-1, -1, -1):
+            child = self.children[i]
+            if isinstance(child, Tree) and child.data in data_values:
                 self.children[i:i+1] = child.children
                 changed = True
         return changed
Change expand_kids_by_data to use range