Skip to content

Commit

Permalink
Use dict comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Sep 3, 2024
1 parent c1f163c commit b369365
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions torchfix/visitors/deprecated_symbols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def read_deprecated_config(path=None):

super().__init__()
self.deprecated_config = read_deprecated_config(deprecated_config_path)
self.old_new_name_map = {}
for name in self.deprecated_config:
new_name = self.deprecated_config[name].get("replacement")
self.old_new_name_map[name] = new_name
self.old_new_name_map = {
name: self.deprecated_config[name].get("replacement")
for name in self.deprecated_config
}

def _call_replacement(
self, node: cst.Call, qualified_name: str
Expand Down

0 comments on commit b369365

Please sign in to comment.