brainhops._core.enum
Functions:
enum_name
Return the name of an enum member, or the text of a plain value.
This function is meant for error messages. Formatting an enum that
derives from int or str in an f-string gives its value on older
versions of Python and its qualified name on newer ones, so reading
the name explicitly keeps a message identical on every version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Enum or int or str
|
An enum member, or a plain value that was not converted to one. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the member, or the value converted to text. |
Examples: