Make cpdef enums into first-class types.
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.
Showing
Please register or sign in to comment