-
-
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
Fix for py39 - unsubscriptable-object #3905
Conversation
I had another take on this one here: #3890 but it's my 1st contrib to pylint, I don't know which one is better. |
* Error occurred for typing.Optional and typing.Union
I think the solution in #3890 is a more correct fix, and resolves this for more than just |
@jreese I'm fine with that, as long as the issue is solved 😄 Please close this PR if you don't need it anymore |
While this bugs seams closed, the sad reality is that the last release was 6 months ago, so py39 users cannot benefit from the bugs fix. Any change to tag a new release? |
@ssbarnea we are working on it. By the way the last pylint release was only 4 months ago. |
@hippo91 Thanks for the update and please excuse my bad math, there were quite long months for most of us. The problems I am facing is that these error reproduce only on py39 but that is more and more popular and because I use pre-commit (tool, not hook), I do not have any way to restrict which python version it will use when running on developer machine. The result is an unpredictable behavior with no know temporary workaround. If the fix is already on master adding a pre-release tag would enable pre-commit users to bump it without even having a full release. In fact it may be possible to do something without a tag but is very ugly, it requires putting a specific revision instead of a tag for version. |
@ssbarnea no worry about the previous release date. |
Description
This PR fixes an issue where
typing.Optional
andtyping.Union
where falsely flagged withunsubscriptable-object
.This error seems to be the result of a changed inference value:
Since I'm new to pylint, this might not be the best place to fix it and I saw that #3894 also addresses this issue in a different spot. Please let me know if I should change something or if you like to continue with the other PR.
Steps
doc/whatsnew/<current release.rst>
.Type of Changes
Related Issue
Closes: #3882
This PR partially addresses #3895