[Python-ideas] Allow multiple imports from a package while preserving its namespace

Serhiy Storchaka storchaka at gmail.com
Fri Apr 27 02:58:30 EDT 2018


27.04.18 02:12, Greg Ewing пише:
> Chris Angelico wrote:
>> +0 for an easier way to import multiple submodules at once. It's not
>> something I've personally had a need for, but it's a sane and logical
>> thing to do.
> 
> Maybe:
> 
>     import display, event, mixer in pygame

I read this as

     import display, event, mixer in pygame
     pygame.display = display
     pygame.event = event
     pygame.mixer = mixer
     del display, event, mixer in pygame



More information about the Python-ideas mailing list