ruff
ruff copied to clipboard
Handle multiple unused submodule imports
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.
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.
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.
Will Red knot address this issue?