26 Apr
2018
26 Apr
'18
1:37 p.m.
On 26 April 2018 at 14:29, Julian DeMille via Python-ideas
I personally would like a feature where instead of doing `from ... import ...` (which imports the specified items into the current namespace), one could use something along the lines of `import <lib>.{ <mod1>, <mod2>, ... }` such that the imported modules/attributes could be accessed as `<lib>.<mod1>`, etc.
What are the benefits of this over a simple "import <lib>"? I get that it will mean that *only* the names listed will be accessible as <lib>.<mod>, but I don't see why that's important (and specifically why it's important enough to warrant dedicated syntax). Hiding names in a namespace isn't typically something that Python provides language support for. Paul