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

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 27 04:08:03 EDT 2018


Serhiy Storchaka wrote:
> 27.04.18 02:12, Greg Ewing пише:
> 
>>     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

It's meant to be shorthand for

    import pygame.display
    import pygame.event
    import pygame.mixer

-- 
Greg


More information about the Python-ideas mailing list