useless-import-alias / C0414¶
Message emitted:
Import alias does not rename original package
Description:
Used when an import alias is same as original package, e.g., using import numpy as numpy instead of import numpy as np.
Problematic code:
import pandas as pandas # [useless-import-alias]
Correct code:
import pandas as pd
Additional details:
Known issue¶
If you prefer to use "from-as" to explicitly reexport in API (from fruit import orange as orange
)
instead of using __all__
this message will be a false positive.
Use --allow-reexport-from-package
to allow explicit reexports by alias
in package __init__
files.
Related links:
Created by the imports checker.