bpo-41816: StrEnum.__str__ is str.__str__ (GH-22362)

use `str.__str__` for `StrEnum` so that `str(StrEnum.member)` is the same as directly accessing the string value of the `StrEnum` member
This commit is contained in:
Ethan Furman 2020-09-22 13:00:07 -07:00 committed by GitHub
parent 947adcaa13
commit d986d1657e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 0 deletions

View file

@ -718,6 +718,8 @@ class StrEnum(str, Enum):
member._value_ = value
return member
__str__ = str.__str__
def _reduce_ex_by_name(self, proto):
return self.name