Skip to content

style: use a generator inside max() in the sync script - #20

Merged
saudzahirr merged 1 commit into
mainfrom
chore/sync-script-generator
Aug 18, 2026
Merged

style: use a generator inside max() in the sync script#20
saudzahirr merged 1 commit into
mainfrom
chore/sync-script-generator

Conversation

@saudzahirr

Copy link
Copy Markdown
Collaborator

One-line follow-up so every copy of sync_python_versions.py stays byte-identical across the org.

Codacy (enabled on sdepack) flags the list comprehension inside max() as R1728 consider-using-generator. Building a throwaway list only to take its maximum allocates for nothing, and the generator is equivalent here because active[0] is always present, so the argument is never empty.

-    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)

Codacy only gates sdepack, but the script is meant to be one canonical file, so this lands everywhere to prevent drift.

Verified: pylint 0, pydocstyle 0, ruff lint and format --check 0 against the repo configs, behaviour unchanged.

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@saudzahirr
saudzahirr merged commit 08d6085 into main Aug 18, 2026
9 checks passed
@saudzahirr
saudzahirr deleted the chore/sync-script-generator branch August 18, 2026 11:29
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant