• Robert Bradshaw's avatar
    Make cpdef enums into first-class types. · 96eea730
    Robert Bradshaw authored
    For example
    
        cpdef enum Eggs
            SOFT
            HARD
            SCRAMBLED
    
    produces three constants with int values that print as strings,
    and a type Eggs with attributes Eggs.SOFT, etc. and list(Eggs)
    giving the set of all enum values.  Instantiating Eggs with a
    numeric or string value will return the appropriate constant.
    96eea730
CpdefEnums.pyx 1.11 KB