mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
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:
parent
947adcaa13
commit
d986d1657e
3 changed files with 48 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue