Remove unused local variables in Lib/ftplib.py#136634
Remove unused local variables in Lib/ftplib.py#136634ChVeen wants to merge 1 commit intopython:mainfrom
Conversation
|
This is a purely cosmetic change and I don't think it's necessary. There are other places where we have unused variables so I'm rather -1 on this one. I would rather prefer a PR that removes all unused variables (and thus an issue), but again, this would still be a purely cosmetic PR that I don't think maintainers would support. |
|
Flake8 complains about more than 800 unused vars within In general, code shouldn't contain unused vars or functions. I prefer clean code, thus this PR 🤷♂️ |
We don't use a linter for
I doesn't really think that it needs to be maintained as it's a code that wouldn't be touched otherwise. As for IDEs warning about it, well.. it's just a simple warning. As for "bloating the code up", I'm not really convinced: it just makes the line a bit longer. What I am more worried about in general is that we have names that could be missing at runtime (we recently fixed multiple
Unused functions may be kept due to backwards compatibility but I agree about unused vars. However, CPython's policy is that we want to avoid cosmetic PRs and prefer making such changes as part of another PR touching the code around. It's common to "clean" surrounding code when fixing bugs or adding features, though.
Yes. Now, we do cosmetic PRs if they indeed improve reading quality (e.g., replacing complex algorithms with simpler and as-efficient alternatives) but in this case, I don't think it helps more. I am even happier to see that the return value is the "response" even though it's not used. In addition, it might be used in the future, and knowing which call defines the "response" is useful. Therefore, I'm going to reject this feature, sorry! |
In order to enhance the code quality, this PR removes unused local variables (
resp) in fileLib/ftplib.py.(I guess, an issue is not needed for this small improvement.)