[docs]classStrEnum(str,Enum):""" Enum where members are also (and must be) strings """def__new__(cls:Type[_S],*values:str)->_S:iflen(values)>3:raiseTypeError("too many arguments for str(): %r"%(values,))iflen(values)==1:# it must be a stringifnotisinstance(values[0],str):raiseTypeError("%r is not a string"%(values[0],))iflen(values)>=2:# check that encoding argument is a stringvalue=values[1]# type: ignoreifnotisinstance(value,str):raiseTypeError("encoding must be a string, not %r"%(value,))iflen(values)==3:# check that errors argument is a stringifnotisinstance(values[2],str):raiseTypeError("errors must be a string, not %r"%(values[2]))value=str(*values)member=str.__new__(cls,value)member._value_=valuereturnmember__str__=str.__str__# type: ignore@staticmethoddef_generate_next_value_(name:str,start:int,count:int,last_values:List[Any])->str:""" Return the lower-cased version of the member name. """returnname.lower()