-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enum: Value 'self.value' is unsubscriptable (unsubscriptable-object) where value is a tuple #2063
Comments
Fix for #29 introduced two pylint "errors" which I believe are bugs in pylint though. The latest pylint version 1.8.4 doesn't help though and so I reported two issues to pylint: pylint-dev/pylint#2062 pylint-dev/pylint#2063 Hockepy will probably have broken builds due to these false positive pylint errors until those two issues are fixed.
Thank you, I can reproduce the issue! |
I am also seeing this now after an upgrade. The message is:
Test case:
|
I was facing the same issue, after providing the type of the value it fixed my issue. So something like: class MyEnum(Enum):
value: Tuple[int, str]
FOO = (1, "f")
BAR = (2, "b")
def __str__(self):
return self.value[1] |
@aakash77 thanks for the hint! |
This no longer appears to be an issue on latest main: pylint 2.14.0-dev0
astroid 2.11.4
Python 3.9.10 (v3.9.10:f2f3f53782, Jan 13 2022, 17:02:14)
[Clang 6.0 (clang-600.0.57)] |
Steps to reproduce
Run
pylint
on the file above.Current behavior
E: 10,15: Value 'self.value' is unsubscriptable (unsubscriptable-object)
Expected behavior
No error -
value
here is a tuple (and can't be reassigned).pylint --version output
The text was updated successfully, but these errors were encountered: