Module is imported with âimportâ and âimport fromâÂķ
ID: py/import-and-import-from
Kind: problem
Security severity:
Severity: recommendation
Precision: very-high
Tags:
- quality
- maintainability
- readability
Query suites:
- python-code-quality.qls
- python-security-and-quality.qls
Click to see the query in the CodeQL repository
Importing a module twice using the import xxx and from xxx import yyy is confusing.
RecommendationÂķ
Remove the from xxx import yyy statement. Add yyy = xxx.yyy if required.
ExampleÂķ
import os
from os import walk
ReferencesÂķ
Python Language Reference: The import statement.