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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy