-
- Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
pylint-dev/astroid
#2277Labels
Crash 💥A bug that makes pylint crashA bug that makes pylint crashNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementationNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds an astroid update (probably a release too) before being mergable
Milestone
Description
Bug description
For the following piece of code pylint gives the error: E1101: Instance of 'str' has no 'value' member (no-member) in python 3.9 and 3.10 but doesn't gives this error in python 3.11, While the code itself works fine. It seems like a false positive for us.
import sys from enum import Enum if sys.version_info >= (3, 11): from enum import StrEnum else: class StrEnum(str, Enum): pass class FilterOperator(StrEnum): IN = "IN" print(FilterOperator.IN.value) Configuration
https://github.com/apache/superset/blob/master/.pylintrc
Command used
pylint -E enum_test.pyPylint output
E1101: Instance of 'str' has no 'value' member (no-member)Expected behavior
pylint should be able to recognize value retrieval for the Enum member.
Pylint version
pylint 2.17.5 astroid 2.15.6 Python 3.9.5 or Python 3.10.6OS / Environment
Linux Based Operating Systems
Additional dependencies
No response
Metadata
Metadata
Assignees
Labels
Crash 💥A bug that makes pylint crashA bug that makes pylint crashNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationThis issue is accepted, sufficiently specified and now needs an implementationNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds an astroid update (probably a release too) before being mergable