-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Fix false positive with inference of type-annotated Enum classes. #1734
Conversation
Pull Request Test Coverage Report for Build 2812103607
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
assert inferred_member_value.value == "sweet" | ||
|
||
|
||
@pytest.mark.parametrize("annotation, value", [("int", 42), ("bytes", b"")]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great parametrization !
…ses. (pylint-dev#1734)" This reverts commit 1a698ac.
This change causes a crash with Home Assistant. I narrowed it down to a custom Enum implementation. from enum import Enum
class Test(Enum):
LOADED = "loaded", True
SETUP_ERROR = "setup_error", True
_recoverable: bool
def __new__(cls, value: str, recoverable: bool):
obj = object.__new__(cls)
obj._value_ = value
obj._recoverable = recoverable
return obj
@property
def recoverable(self) -> bool:
"""Get if the state is recoverable."""
return self._recoverable Remove / comment |
Thanks Marc. Will submit a patch when I get a chance today |
Closes pylint-dev/pylint#7265
Steps
Description
Type of Changes
Related Issue