We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import a
import a.b
When there is already import a.b then import a is implicitly executed and a is added as a name. Hence, it does not make sense to have both like:
a
import logging # this is superfluous import logging.handlers
This is sufficient, isort should remove the superfluous import
import logging.handlers
Reference:
https://docs.python.org/3/reference/simple_stmts.html#the-import-statement ("Examples") https://docs.python.org/3/reference/import.html#the-module-cache
Note: if there is an import alias, only the last name is bound, hence in that case nothing can be removed:
import logging # not superfluous import logging.handlers as log_handlers
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When there is already
import a.b
thenimport a
is implicitly executed anda
is added as a name. Hence, it does not make sense to have both like:This is sufficient, isort should remove the superfluous import
Reference:
https://docs.python.org/3/reference/simple_stmts.html#the-import-statement ("Examples")
https://docs.python.org/3/reference/import.html#the-module-cache
Note: if there is an import alias, only the last name is bound, hence in that case nothing can be removed:
The text was updated successfully, but these errors were encountered: