Skip to content

Enum dunder method _generate_next_value_ not allowed #10435

@n4nn31355

Description

@n4nn31355

Bug description

Enum dunder method _generate_next_value_ is missing in list of allowed methods

# Bad or misspelled dunder method name _generate_next_value_. Pylint(W3201:bad-dunder-name)
class PylintDunderEnum(Enum):
    @staticmethod
    def _generate_next_value_(
        name: str, _start: int, _count: int, _last_values: list[Any]
    ) -> Any:
        return name

Configuration

Command used

pylint .\enums.py

Pylint output

.\enums.py:4:4: W3201: Bad or misspelled dunder method name _generate_next_value_. (bad-dunder-name)

Expected behavior

No error when Enum dunder method _generate_next_value_ is used

Pylint version

pylint 3.3.7
astroid 3.3.10
Python 3.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]

OS / Environment

No response

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions