Skip to content

invalid-name false-positive on Enum functional syntax on pylint v4 #10660

@tales-aparecida

Description

@tales-aparecida

Bug description

"""Example"""
from enum import Enum
Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])

Command used

pylint a.py

Pylint output

************* Module a
/tmp/a.py:3:0: C0103: Constant name "Color" doesn't conform to UPPER_CASE naming style (invalid-name)

------------------------------------------------------------------
Your code has been rated at 5.00/10 (previous run: 5.00/10, +0.00)

Expected behavior

Since TypeVar is supported, I'd expect the functional syntax example from https://docs.python.org/3/library/enum.html to work

Pylint version

pylint 4.0.0
astroid 4.0.1
Python 3.13.7 (main, Aug 14 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)]

Metadata

Metadata

Labels

C: invalid-nameNeeds 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