@lower_getattr_generic(types.EnumClass)
def enum_class_lookup(context, builder, ty, val, attr):
 member = getattr(ty.instance_class, attr)
 return context.get_constant_generic(builder, ty.dtype, member.value)

@ lower_getattr_generic ( types . EnumClass ) def enum_class_lookup ( context , builder , ty , val , attr ) : member = getattr ( ty . instance_class , attr ) return context . get_constant_generic ( builder , ty . dtype , member . value )
return an enum member by name .