Star import from multiple modules in one-liner altogether

First off, by the term “star import” I’m implying the usage from x import *

I have noticed the so mentioned “star import” being marked as a bad practice across the internet. I’m aware that with proper use of __all__ star imports can be a really clean approach to imports.

While writing some python lines few days back, I faced the following block:

from api import *
from components import *
from layout import *
from settings import *
from utils import *

My idea is to boil this block down to:

from api, components, layout, settings, utils import *

To further elaborate, my idea is to allow combining star imports (separate modules by commas) and writing one-liners

Thanks for the suggestion. But writing one-liners and making star imports easier is something which I don’t think is going to get any traction.


The reason that star imports are discouraged is that they make it hard to see where a particular name has been imported from. Using multiple star imports into the same namespace is especially problematic because then there are many potentially conflicting locations that need to be searched to find where a name has been imported from. Adding dedicated syntax for multiple star imports does not seem like a useful language change.


In code the horizontal space is precious, and the vertical space is free.