[Python-ideas] Importing public symbols and simultainiously privatizing them, is too noisy

Steven D'Aprano steve at pearwood.info
Wed Mar 16 20:35:45 EDT 2016


On Wed, Mar 16, 2016 at 03:50:53PM -0700, Rick Johnson wrote:

>   from module _import Foo, bar

That's anything but self-explanatory, since it gives no hint that Foo 
and bar will be imported under some name other than Foo and bar.

Besides, why is "import x as _x" so special to require special syntax? 
Out of the infinite number of names that x could be imported as (import 
x as y etc) what's so special about _x that it deserves a short-cut? 



-- 
Steve


More information about the Python-ideas mailing list