Skip to content

Simplify AbstractPkg._gather_aux to resolve consider-using-enumerate - #1383

Merged
danigm merged 1 commit into
rpm-software-management:mainfrom
vil02:resolve_consider-using-enumerate
Aug 21, 2025
Merged

Simplify AbstractPkg._gather_aux to resolve consider-using-enumerate#1383
danigm merged 1 commit into
rpm-software-management:mainfrom
vil02:resolve_consider-using-enumerate

Conversation

@vil02

@vil02 vil02 commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

The main reason for this PR is to resolve consider-using-enumerate / C0200. But I also decided to reduce the scope of names and flags.

@vil02
vil02 force-pushed the resolve_consider-using-enumerate branch from 029c232 to 0b193d2 Compare August 20, 2025 21:03
Comment thread rpmlint/pkg.py
prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr))
names = header[nametag]
flags = header[flagstag]
for version, name_bytes, flag in zip(versions, names, flags):

@vil02 vil02 Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I would use:

Suggested change
for version, name_bytes, flag in zip(versions, names, flags):
for version, name_bytes, flag in zip(versions, names, flags, strict=True):

This is available starting from python 3.10 (cf. PEP618) and this project claims to work for any python starting from 3.8:

- Python 3.8 or newer

@vil02
vil02 marked this pull request as ready for review August 20, 2025 21:09

@danigm danigm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danigm
danigm merged commit 6a10a50 into rpm-software-management:main Aug 21, 2025
12 checks passed
@vil02
vil02 deleted the resolve_consider-using-enumerate branch August 21, 2025 06:34
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.

2 participants