-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Enum in Python has a few supported sunder names. Of them, _missing_ and _generate_next_value_ are explicitly called out as overridable but when doing so they get flagged as misspelled dunder methods.
Looks separate from, but related to #4592.
from enum import StrEnum
class Build(StrEnum):
@classmethod
def _missing_(cls, value):
pass$ ruff --isolated --preview --select PLW3201 --show-source test.py
test.py:4:9: PLW3201 Bad or misspelled dunder method name `_missing_`. (bad-dunder-name)
|
2 | class Build(StrEnum):
3 | @classmethod
4 | def _missing_(cls, value):
| ^^^^^^^^^ PLW3201
5 | pass
|Observed using ruff 0.0.292.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working