[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 26 03:10:07 CEST 2013


On 26/04/13 11:53, Ethan Furman wrote:
>
> --> from Color import * # doesn't work in a function, though :(
>
> Yeah, that would be nice. ;) A bit dangerous, though -- what if another module
> does the same thing, but its Color is different?

It needs to put foo.Color in sys.modules, where foo is the
name of the defining module. Then you do

    from foo.Color import *

The drawback being that you need to write the name of the
module into the import statement. It's disappointing that
the import syntax doesn't have a way of saying "this module".

-- 
Greg


More information about the Python-Dev mailing list