#! python3
from enum import Enum
class BaseEnum(Enum):
def some_behavior(self):
pass
class MyEnum(BaseEnum):
FOO = 1
BAR = 2
print(MyEnum.FOO.value)
Run pylint on the above file.
E: 16, 0: Instance of 'int' has no 'value' member (no-member)
No error.
(Subclassing an enumeration is allowed only if the enumeration does not define any members. )
No config file found, using default configuration
pylint 1.9.1,
astroid 1.6.2
Python 3.6.0 (default, Apr 2 2018, 14:01:47)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]
Thank you for the report!
Notably, this affects enum.Flag and other standard classes which derive from Enum.
class Foo(enum.Flag):
NONE = 0
BAR = 1
BAZ = 2
print(Foo.NONE.value)
I believe it's fixed in a recent release.
Which release?
Still happening in version 2.4.3.
Just found the issue in 2.4.4
same here, will it be updated?
any update on this?
still happens in
pylint 2.6.0
astroid 2.4.2
Python 3.8.6 (default, Sep 24 2020, 22:01:47)
[GCC 9.3.0]
Most helpful comment
any update on this?
still happens in
pylint 2.6.0
astroid 2.4.2
Python 3.8.6 (default, Sep 24 2020, 22:01:47)
[GCC 9.3.0]