[Python-ideas] constant/enum type in stdlib

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 2 01:53:03 CET 2013


Joao S. O. Bueno wrote:
> class MyEnum(Enum):
>      RED, GREEN, BLUE
> 
> load_constants(MyEnum, globals() )

The "obvious" way to spell this would be

    from MyEnum import *

but it would be challenging to make that work, I suspect. :-(

-- 
Greg



More information about the Python-ideas mailing list