Tom Ritchford
Mar 7, 2021

--

Just a quibble here, but from parent_module import * is very much like inheritance for modules.

I don't suggest using it very often - in fact, I have a near-absolute prohibition on import * in any codebase I have any control over - but there are real uses for it.

In particular, some Python modules are written in C and Python, where _foo is the C module and foo the Python one, which starts with from _foo import *.

Great article!

--

--

Responses (1)