Skip to content

Commit

Permalink
Fix setting negative index values
Browse files Browse the repository at this point in the history
  • Loading branch information
slundberg committed Jun 15, 2023
1 parent 89e45d5 commit 79fd06a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guidance/_variable_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __setitem__(self, key, value):
found = True
for part in parts:
if part.endswith("]"):
if re.match(r"['\"0-9].*", part):
if re.match(r"[-'\"0-9].*", part):
var_part = ast.literal_eval(part[:-1])
else:
var_part = self.get(part[:-1])
Expand Down

0 comments on commit 79fd06a

Please sign in to comment.