-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Remove not-context-manager lint rule #12399
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 9082005902Details
💛 - 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.
Thanks for looking at this. I'm not super keen to merge this one as-is, because I think the problem is more likely a bug in Astroid's inference. I do think there's typing problems in the currently spelling, but when I fixed those locally (so mypy is happy with things), it didn't fix the inference that pylint/astroid were pulling out - they were detecting the return type from the context-manager form as None
, which was definitely false.
I'm roughly keen to work out why pylint's getting it wrong, because I think there should be a version of the typing.overload
hinting that works - I think removing it entirely will cause Mypy to fail (not that it passes on Qiskit at the moment) because it would then think that it's undecideable whether the ersult . I think at the moment it's probably passing pylint only because it can't tell, so it errs on the safe side.
@jakelishman not surprised about not being keen on it- i wasn't thrilled about the possible mismatching |
looks like it's better to close this as the base has changed and the current changes are not inline with expectations. a fresh start is best i think, but i will probably have to bow out as well from this since i haven't made much progress |
Summary
#9614 removing
not-context-manager
Details and comments
This is the only way i could find to get the typing to not be an issue other than removing it completely