Skip to content

Commit

Permalink
Prefer dict literals over dict constructor
Browse files Browse the repository at this point in the history
More idiomatic and (very very slightly) faster.
  • Loading branch information
jdufresne committed Mar 8, 2021
1 parent 74aa521 commit 1d0c9b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ def resolve_reqs(self, download_dir, ireq, wheel_cache):
with get_requirement_tracker() as req_tracker, TempDirectory(
kind="resolver"
) as temp_dir, indent_log():
preparer_kwargs = dict(
temp_build_dir=temp_dir,
options=self.options,
req_tracker=req_tracker,
session=self.session,
finder=self.finder,
use_user_site=False,
download_dir=download_dir,
)
preparer_kwargs = {
"temp_build_dir": temp_dir,
"options": self.options,
"req_tracker": req_tracker,
"session": self.session,
"finder": self.finder,
"use_user_site": False,
"download_dir": download_dir,
}
preparer = self.command.make_requirement_preparer(**preparer_kwargs)

reqset = RequirementSet()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_minimal_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
)
def test_no_upgrades(base_resolver, repository, from_line, input, pins, expected):
input = [from_line(line) for line in input]
existing_pins = dict()
existing_pins = {}
for line in pins:
ireq = from_line(line)
existing_pins[key_from_ireq(ireq)] = ireq
Expand Down

0 comments on commit 1d0c9b1

Please sign in to comment.