Skip to content

Commit 175f6b9

Browse files
deepsource-autofix[bot]1minds3t
authored andcommitted
refactor: remove unnecessary lambda expression
A lambda that calls a function without modifying any of its parameters is unnecessary. Python functions are first-class objects and can be passed around in the same way as the resulting lambda. It is recommended to remove the lambda and use the function directly.
1 parent 4534262 commit 175f6b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/omnipkg/loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ def _detect_omnipkg_dependencies(self):
939939
try:
940940
# Simple cleanup of the name to find the target
941941
# e.g., aiohttp.123_omnipkg_cloaked -> aiohttp
942-
newest_cloak = sorted(cloaks, key=lambda p: str(p), reverse=True)[0]
942+
newest_cloak = sorted(cloaks, key=str, reverse=True)[0]
943943
original_name = re.sub(
944944
r"\.\d+_omnipkg_cloaked.*$", "", newest_cloak.name
945945
)
@@ -2071,7 +2071,7 @@ def _enter_single(self):
20712071
self.multiversion_base.glob(f"{pkg_name}-{version_form}.*_omnipkg_cloaked")
20722072
)
20732073
if cloaked_bubbles:
2074-
target = sorted(cloaked_bubbles, key=lambda p: str(p), reverse=True)[0]
2074+
target = sorted(cloaked_bubbles, key=str, reverse=True)[0]
20752075
if not self.quiet:
20762076
safe_print(_(' 🔓 Found CLOAKED bubble {}, restoring...').format(target.name))
20772077
try:

0 commit comments

Comments
 (0)