pylint icon indicating copy to clipboard operation
pylint copied to clipboard

E0238 false positive when defining __slots__ in IntEnum class

Open rgeronimi opened this issue 1 year ago • 0 comments

Bug description

"""Sample reproduction case for the bug. Please save as case.py."""

import enum

class Priority(enum.IntEnum):
    """Sample class illustrating the bug."""

    __slots__ = ()

    LOW = enum.auto()
    MEDIUM = enum.auto()
    HIGH = enum.auto()
    CRITICAL = enum.auto()

Configuration

No response

Command used

pylint case.py

Pylint output

************* Module case
case.py:5:0: E0238: Invalid __slots__ object (invalid-slots)

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

Expected behavior

There should have been no invalid-slots error

Pylint version

pylint 3.2.6
astroid 3.2.4
Python 3.12.4 | packaged by conda-forge | (main, Jun 17 2024, 10:13:44) [Clang 16.0.6 ]

OS / Environment

MacOS Sonoma 14.5 (23F79)

Additional dependencies

No response

rgeronimi avatar Jul 29 '24 12:07 rgeronimi