Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylint false positive - Instance of 'str' has no 'value' member (no-member) #8897

Closed
mdeshmu opened this issue Jul 28, 2023 · 2 comments · Fixed by pylint-dev/astroid#2277
Closed
Assignees
Labels
Crash 💥 A bug that makes pylint crash Needs astroid update Needs an astroid update (probably a release too) before being mergable Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@mdeshmu
Copy link

mdeshmu commented Jul 28, 2023

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.py

Pylint 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.6

OS / Environment

Linux Based Operating Systems

Additional dependencies

No response

@mdeshmu mdeshmu added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jul 28, 2023
@mbyrnepr2 mbyrnepr2 self-assigned this Aug 7, 2023
@jacobtylerwalls jacobtylerwalls added Crash 💥 A bug that makes pylint crash Needs astroid update Needs an astroid update (probably a release too) before being mergable Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 7, 2023
@jacobtylerwalls jacobtylerwalls added this to the 2.17.6 milestone Aug 7, 2023
mbyrnepr2 added a commit to mbyrnepr2/astroid that referenced this issue Aug 7, 2023
mbyrnepr2 added a commit to mbyrnepr2/astroid that referenced this issue Aug 7, 2023
mbyrnepr2 added a commit to mbyrnepr2/astroid that referenced this issue Aug 7, 2023
mbyrnepr2 added a commit to mbyrnepr2/astroid that referenced this issue Aug 7, 2023
@mdeshmu
Copy link
Author

mdeshmu commented Oct 8, 2023

which recent pylint version was this issue fixed in?

@Pierre-Sassoulas
Copy link
Member

According to the milestone assigned to this issue, 2.17.6 and above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash 💥 A bug that makes pylint crash Needs astroid update Needs an astroid update (probably a release too) before being mergable Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants