Skip to content

A dataclass of type enum.Enum does not contain the enum __members__ object #2317

Open
@mbyrnepr2

Description

@mbyrnepr2

Steps to reproduce

See pylint-dev/pylint#9100 for context/original report.
A fix is made to Pylint to prevent the crash but work required in astroid to fix the root cause.

Current behavior

A false positive in Pylint for invalid-name:

from dataclasses import dataclass
from enum import Enum


@dataclass
class Something(str, Enum):
	asd: str = 1  # [invalid-name]

Expected behavior

No false positive

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

3.1.0-dev0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions