Skip to content

chore: add ruff PYI#1026

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
henryiii:henryiii/chore/ruff-PYI
Apr 10, 2026
Merged

chore: add ruff PYI#1026
gaborbernat merged 1 commit into
pypa:mainfrom
henryiii:henryiii/chore/ruff-PYI

Conversation

@henryiii

Copy link
Copy Markdown
Contributor

Description

Adding the PYI check.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@gaborbernat gaborbernat enabled auto-merge (squash) April 10, 2026 18:54
@gaborbernat gaborbernat merged commit 0b1ca1c into pypa:main Apr 10, 2026
65 checks passed
Comment thread src/build/_util.py
if TYPE_CHECKING:
from collections.abc import Iterator, Set
from collections.abc import Iterator
from collections.abc import Set as AbstractSet

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.

Why Set as AbstractSet?

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.

It's a ruff rule to keep it from looking like dict/Dict or list/List, which are the same thing, but just typing versions. While Set is not a set, it's an immutable set-like ABC. frozenset is also a valid Set. It's more like Sequence, etc.

Not my favorite rule (as Dict/List and similar classes become less common, it's less important), but it's fine. (BTW, let me know if you know another name vs. AbstractSet, this is just the suggestion).

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.

Ah, I didn't realise this was part of the ruleset. That's fair enough then, let's leave it be.

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.

3 participants