Skip to main content

is_enum_class

Function is_enum_class 

fn is_enum_class(value: &Bound<'_, PyAny>) -> bool
Expand description

Whether value is a subclass of enum.Enum.

Answered by walking __mro__ rather than by importing enum and calling issubclass, so the check cannot fail in a way that silently reports “not an enum” and sends the class down the ordinary-class path, where it would die on _member_map_.