vulture
vulture copied to clipboard
Feature request: not throw "unused variable" for __exit__
Are you willing to consider built-in whitelisting "unused variable" reports for context management's __exit__
?
Context management is a fundamental aspect of Python, with __exit__
's signature documented in Python's data model. Furthermore, __exit__
's signature is autocompleted by IDE's like PyCharm. I don't think one should have to explicitly go back and replace commonly unused argument names like exc_type
with _
.
Considering this is overrideable built-in object
functionality, I think having unused arguments should be allowed by default.
What do you think?
Disclaimer: this issue is a blatent duplicate of https://github.com/jendrikseipp/vulture/issues/39, but I didn't want to grave dig an issue from over 5 years ago.
I still believe that the best way to solve this is to explicitly mark the arguments as unused. There's nothing special about the argument names, and they might even change between Python releases. I updated issue #39 with more recommendations for marking the arguments as unused.