Skip to content

Strange autofix for PYI025 if "Set" is included in __all__ #10508

@AlexWaygood

Description

@AlexWaygood

The following snippet correctly causes Ruff to emit PYI025:

from collections.abc import Set as Set

__all__ = ["Set"]

But if you apply the autofix, it "fixes" it to this, which is... not correct:

from collections.abc import Set as AbstractSet

AbstractSet = ["Set"]

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixesRelated to suggested fixes for violationslinterRelated to the linter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions