CodeQL documentation

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-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

  • © GitHub, Inc.
  • Terms
  • Privacy
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy