From 654695a0a141a766228b2734b58f255267af2bf6 Mon Sep 17 00:00:00 2001 From: saudzahirr Date: Tue, 18 Aug 2026 16:26:43 +0500 Subject: [PATCH] style: use a generator inside max() in the sync script Codacy flags the list comprehension as R1728 (consider-using-generator). Building the list only to take its max allocates for nothing, and the generator is equivalent here because active[0] is always present, so the argument is never empty. Keeps this copy byte-identical to the one in the other repos. Co-Authored-By: Claude Opus 5 (1M context) --- .github/scripts/sync_python_versions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/sync_python_versions.py b/.github/scripts/sync_python_versions.py index 198ebcd..1ffea92 100644 --- a/.github/scripts/sync_python_versions.py +++ b/.github/scripts/sync_python_versions.py @@ -244,7 +244,7 @@ def resolve(project: Table, active: list[str]) -> Resolved: requires = str(project.get("requires-python", "")).strip() match = FLOOR.search(requires) was_floor = match.group(1) if match else None - floor = max([f for f in (was_floor, active[0]) if f], key=key) + floor = max((f for f in (was_floor, active[0]) if f), key=key) supported = [v for v in active if key(v) >= key(floor)] if not supported: fail(f"floor {was_floor} excludes every active version")