-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
good first issueGood for newcomersGood for newcomersruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Since Python 3.11 there are now StrEnum and IntEnum:
from enum import Enum, IntEnum, StrEnum
class Foo(str, Enum): ... # Python<3.11
class Foo(StrEnum): ... # Python>=3.11
class Bar(int, Enum): ... # Python<3.11
class Bar(IntEnum): ... # Python>=3.11pyupgrade can be used to suggest this change.
However, this request was rejected in pyupgrade itself here: asottile/pyupgrade#779. Apparently they're not identical in behavior. Luckily, ruff has a concept of safe vs unsafe, so I think ruff can actually implement this rule.
The request here is for ruff to suggest this upgrade as an unsafe fix, ideally with autofix support.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersruleImplementing or modifying a lint ruleImplementing or modifying a lint rule