Skip to content

Commit

Permalink
Merge pull request #417 from MarcoGorelli/use-comprehension
Browse files Browse the repository at this point in the history
CLN - use dict comprehension in _format_params
  • Loading branch information
asottile authored Apr 3, 2021
2 parents 2e32e37 + b468218 commit 5495a24
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pyupgrade/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,7 @@ def _simple_arg(arg: ast.expr) -> bool:


def _format_params(call: ast.Call) -> Dict[str, str]:
params = {}
for i, arg in enumerate(call.args):
params[str(i)] = _unparse(arg)
params = {str(i): _unparse(arg) for i, arg in enumerate(call.args)}
for kwd in call.keywords:
# kwd.arg can't be None here because we exclude starargs
assert kwd.arg is not None
Expand Down

0 comments on commit 5495a24

Please sign in to comment.