Open
Description
Current problem
I was reading the documentation for ungrouped-imports
:
https://pylint.readthedocs.io/en/stable/user_guide/messages/convention/ungrouped-imports.html
Under "Correct code" it says:
import logging
import logging.config
But for me this is not "correct", but bad style because import logging
is superfluous anyway. logging
is implicitly imported with import logging.config
.
See also:
https://docs.python.org/3/reference/simple_stmts.html#the-import-statement ("Examples")
https://docs.python.org/3/reference/import.html#the-module-cache
Desired solution
I suggest to change the example in the documentation to use logging.config
and logging.handlers
.
I also suggest to introduce a checker to warn about such superfluous import statements.
Additional context
No response