Skip to content

SLOT: Classes with multiple base classes #15879

Open
@Skylion007

Description

Description

ruff check --select=SLOT .
ruff --version 0.8.4
class Backend(RandomClass, tuple):
   pass

^ suggests a fixit here. This is the recommended class structure for old versions of python before strenum was introduced. However, enum doesn't have slots defined, so defining a __slots__ wouldn't be that helpful. i also see this bug happen when a class has multiple ancestors, one of which is a tuple.

Actually, nevermind, this error was actually masking another error where enum was not properly imported. Seems odd to suggest a fixit in this situation. In other cases though, I do see the error pop up when only one of the ancestors is a tuple.

Metadata

Assignees

No one assigned

    Labels

    ruleImplementing or modifying a lint ruletype-inferenceRequires more advanced type inference.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions