Jake Lishman 4/13/2020

Detecting star imports in Python

Read Original

This technical article discusses Python's import system, specifically the challenges of wildcard (star) imports. It explains how to detect when a module is imported via 'from module import *' to issue warnings, as part of a strategy to reduce namespace pollution and improve import performance in scientific computing libraries like QuTiP. It covers the import statement forms, the __all__ variable, and module initialization.

Detecting star imports in Python

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week