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

False positive no-member for enum.Enum when imported with alias #5776

Closed
bluefish6 opened this issue Feb 7, 2022 · 0 comments · Fixed by #6798
Closed

False positive no-member for enum.Enum when imported with alias #5776

bluefish6 opened this issue Feb 7, 2022 · 0 comments · Fixed by #6798
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code inference
Milestone

Comments

@bluefish6
Copy link

Bug description

Enum is not being recognised as an Enum, when it's imported with an alias (to prevent confusion when also doing from sqlalchemy.dialects.postgresql import ENUM)

from enum import Enum as PyEnum


class MyEnum(PyEnum):
    ENUM_KEY = "enum_value"


foo = MyEnum.ENUM_KEY.value

Configuration

No response

Command used

pylint example.py

Pylint output

************* Module example
example.py:8:6: E1101: Instance of 'str' has no 'value' member (no-member)

Expected behavior

No error

Pylint version

pylint 2.12.2
astroid 2.9.3
Python 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]

OS / Environment

Ubuntu 20.04.3 LTS

Additional dependencies

No response

@bluefish6 bluefish6 added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Feb 7, 2022
@Pierre-Sassoulas Pierre-Sassoulas added inference False Positive 🦟 A message is emitted but nothing is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Feb 7, 2022
@jacobtylerwalls jacobtylerwalls added this to the 2.15.0 milestone Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code inference
Projects
None yet
3 participants