summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2020-09-22 20:00:07 (GMT)
committerGitHub <noreply@github.com>2020-09-22 20:00:07 (GMT)
commitd986d1657e1e7b50807d0633cb31d96a2d866d42 (patch)
tree2565f560e2ccacd2655c9e1fcbeff429c27750de /Lib/enum.py
parent947adcaa13080790167757664912c3a6c2d4c201 (diff)
downloadcpython-d986d1657e1e7b50807d0633cb31d96a2d866d42.zip
cpython-d986d1657e1e7b50807d0633cb31d96a2d866d42.tar.gz
cpython-d986d1657e1e7b50807d0633cb31d96a2d866d42.tar.bz2
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
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 589b17f..40ff25b 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -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