Skip to content

pylint does not recognise from ... import inside an IntEnum class body as producing enum members. It infers the members as int instead of LogLevel, causing a spurious E1101: Instance of 'int' has no 'value' member (no-member) error. #10951

@peturingi

Description

@peturingi

Bug description

pylint does not recognise from ... import inside an IntEnum class body as producing enum members. It infers the members as int instead of LogLevel, causing a spurious E1101: Instance of 'int' has no 'value' member (no-member) error.

python
from enum import IntEnum

class LogLevel(IntEnum):
    from syslog import (
        LOG_CRIT as CRITICAL,
        LOG_EMERG as EMERGENCY,
        LOG_ERR as ERROR,
        LOG_WARNING as WARNING,
        LOG_INFO as INFO,
        LOG_DEBUG as DEBUG,
    )

print(LogLevel.EMERGENCY.value)

Configuration

Command used

pylint demo.py

Pylint output

demo.py:15:6: E1101: Instance of 'int' has no 'value' member (no-member)

Expected behavior

No error.

Pylint version

pylint 4.0.5
astroid 4.0.4
Python 3.14.0 (v3.14.0:ebf955df7a8, Oct  7 2025, 08:20:14) [Clang 16.0.0 (clang-1600.0.26.6)]

OS / Environment

Darwin pet 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:56:35 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6030 arm64

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    AstroidRelated to astroidFalse Positive 🦟A message is emitted but nothing is wrong with the codeenum

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions