(enum, key)
return list(enum).index(key)
Enums, by default, are not int-comparable, so use an ad-hoc mapping of
    enum key to its int position
Enums, by default, are not int-comparable, so use an ad-hoc mapping of
    enum key to its int position
Enums by default are not int - comparable so use an ad - hoc mapping of enum key to its int position
def enum_to_index(enum, key):
    """Enums, by default, are not int-comparable, so use an ad-hoc mapping of
    enum key to its int position"""
    return list(enum).index(key)
def enum_to_index ( enum , key ) : return list ( enum ) . index ( key )