-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
unsubscriptable-object error reported incorrectly #2416
Comments
Python 3.7 gets this rule wrong for `Generic[]`. pylint-dev/pylint#2416 tracks this issue in pylint.
Python 3.7 gets this rule wrong for `Generic[]`. pylint-dev/pylint#2416 tracks this issue in pylint.
Python 3.7 gets this rule wrong for `Generic[]`. pylint-dev/pylint#2416 tracks this issue in pylint.
I believe this is due to Generic using PEP 560 introduced |
positives for `no-self-argument` and `unsubscriptable-object`. https://www.python.org/dev/peps/pep-0560/ Fixes pylint-dev#2416
…alse positives for `no-self-argument` and `unsubscriptable-object`. https://www.python.org/dev/peps/pep-0560/ Close pylint-dev#2416
…alse positives for `no-self-argument` and `unsubscriptable-object`. https://www.python.org/dev/peps/pep-0560/ Close pylint-dev#2416
Take into account `__class_getitem__` from PEP 560 and fixes some false positives for `no-self-argument` and `unsubscriptable-object` PEP: https://www.python.org/dev/peps/pep-0560/ Close #2416
Thanks @pcorpet for the PR! |
Thanks for hard work at pylint! Is it possible to use version with fix for Generic? |
@PCManticore Could you please release this fix? |
@vyshkant I'll do a Pylint release today. |
Thank you! I can verify that this fixed the issue on our end. |
The unsubscriptable object errors are fixed in Pylint, pylint-dev/pylint#2416, but the fixed release is not available via prospector.
Steps to reproduce
Run Pylint on the following code:
Current behavior
Pylint reports the following error:
E1136: Value 'Generic' is unsubscriptable (unsubscriptable-object)
Expected behavior
No error should be reported. Python documentation for
Generic
explicitly lists use cases whereGeneric
is subscripted.pylint --version output
This issue is not reproducible with Python 3.6. Might be related to issue #2377, which is only reproducible with Python 3.6.
The text was updated successfully, but these errors were encountered: