From b468218a15a73521c72e9694ed4c5966a2ac1601 Mon Sep 17 00:00:00 2001 From: Marco Gorelli Date: Sat, 3 Apr 2021 15:00:39 +0100 Subject: [PATCH] use dict comprehension --- pyupgrade/_main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyupgrade/_main.py b/pyupgrade/_main.py index c5628b1f..86c3a97f 100644 --- a/pyupgrade/_main.py +++ b/pyupgrade/_main.py @@ -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