-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix 4689 Exclude ThreadPoolExecutor
and ProcessPoolExecutor
from consider-using-with
#4721
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 4689 Exclude ThreadPoolExecutor
and ProcessPoolExecutor
from consider-using-with
#4721
Conversation
…is assigned to a variable. Instead check if it is used later on in a ``with`` block.
…f callables that trigger the ``consider-using-with`` message
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.
Thank you for taking the time to fix the false positive for this checker and participating in the issue related to it, much appreciated ! I made some suggestion feel free to ignore if it's not relevant.
Thanks for the review, I will implement the suggested changes (but only tomorrow). |
Co-authored-by: Pierre Sassoulas <[email protected]>
Thanks for the fix ! This was the last MR for pylint 2.9.4 I'm going to release it now :) |
Steps
doc/whatsnew/<current release.rst>
.Description
This PR addresses two issues:
ThreadPoolExecutor
andProcessPoolExecutor
fromconsider-using-with
, asconsider-using-with
on ThreadPoolExecutor? #4689 points out that legitimate use cases exist where they are used without awith
block.with
block. Therefore, the following (although unusual, there are probably better examples for this) will no longer emit aconsider-using-with
message:Type of Changes
Related Issue
Closes #4689