def _format_enum_values(values: List[int],
enum_class: Type[Enum]):
"""
Formats a list of enum values represented by their numeric value, which may contain missing values indicated by
None.
Returns a list containing a string representation for each list element, which is "None" if the element is None, or
the name of the enum member corresponding to the numeric value in the list otherwise.
Parameters
----------
values: list
A list of numeric enum values
enum_class: Type[Enum]
The enum type
Returns
-------
list
A list of strings containing a string representation for each element in the specified list
"""
return ["None" if x == _MISSING_VALUE_INT else enum_class(x).name for x in values]
评论列表
文章目录