Skip to content

Commit 7e5a226

Browse files
Aareonnorvig
authored andcommitted
Remove range(len(self.args)) in favor of enumerate (aimacode#649)
Throw away the second argument returned by enumerate as we do not use it. Otherwise, name `_` arg simplify the rest of this function using the returned values rather than just indexes.
1 parent 75c2a8e commit 7e5a226

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

planning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def substitute(self, e, args):
6666
"""Replaces variables in expression with their respective Propositional symbol"""
6767
new_args = list(e.args)
6868
for num, x in enumerate(e.args):
69-
for i in range(len(self.args)):
69+
for i, _ in enumerate(self.args):
7070
if self.args[i] == x:
7171
new_args[num] = args[i]
7272
return Expr(e.op, *new_args)

0 commit comments

Comments
 (0)