Parser of an Enum class member.
Inherits From: ArgumentParser
tf.compat.v1.flags.EnumClassParser(
enum_class
)
enum_class
: class, the Enum class with all possible flag values.TypeError
: When enum_class is not a subclass of Enum.ValueError
: When enum_class is empty.flag_type
flag_type()
See base class.
parse
parse(
argument
)
Determines validity of argument and returns the correct element of enum.
argument
: str or Enum class member, the supplied flag value.The first matching Enum class member in Enum class.
ValueError
: Raised when argument didn't match anything in enum.