Skip to content

Commit aada1f2

Browse files
committed
fix: use partial instead of lambda
Signed-off-by: Frost Ming <[email protected]>
1 parent 86bbb0d commit aada1f2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/packaging/markers.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import platform
1010
import sys
11+
from functools import partial
1112
from typing import AbstractSet, Any, Callable, Literal, TypedDict, Union, cast
1213

1314
from ._parser import MarkerAtom, MarkerItem, MarkerList, Op, Value, Variable
@@ -239,13 +240,9 @@ def _evaluate_markers(
239240
assert isinstance(marker, (list, tuple, str))
240241

241242
if isinstance(marker, list):
242-
groups[-1].append(
243-
lambda marker=marker: _evaluate_markers(marker, environment)
244-
)
243+
groups[-1].append(partial(_evaluate_markers, marker, environment))
245244
elif isinstance(marker, tuple):
246-
groups[-1].append(
247-
lambda marker=marker: _evaluate_marker_item(marker, environment)
248-
)
245+
groups[-1].append(partial(_evaluate_marker_item, marker, environment))
249246
else:
250247
assert marker in ["and", "or"]
251248
if marker == "or":

0 commit comments

Comments
 (0)