Skip to content
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

Handle multiple unused submodule imports #60

Open
charliermarsh opened this issue Aug 31, 2022 · 3 comments · May be fixed by #13965
Open

Handle multiple unused submodule imports #60

charliermarsh opened this issue Aug 31, 2022 · 3 comments · May be fixed by #13965
Labels
bug Something isn't working

Comments

@charliermarsh
Copy link
Member

pylint does this properly, Flake8 does not.

For example, with this:

import multiprocessing.pool
import multiprocessing.process

Flake8 will only mark the second import as unused.

@charliermarsh charliermarsh added the bug Something isn't working label Aug 31, 2022
@squiddy
Copy link
Contributor

squiddy commented Nov 9, 2022

I have a question concerning a slightly adjusted example.

import multiprocessing.pool
import multiprocessing.process

z = multiprocessing.pool.ThreadPool()

pylint and flake8 don't see any unused import here. I would argue import multiprocessing.process is.

Update Working on this, PR incoming.

@ThiefMaster
Copy link
Contributor

Would you consider exempting F401 from RUF100 until this is solved?

Even if ruff cannot handle this correctly, it'd be much cleaner if as a developer one could still add the proper noqa on each such unused import simply to indicate to other developers that they are aware of it being unused.

@JonathanPlasse
Copy link
Contributor

Will Red knot address this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants