summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index ca6aff6..bcf411c 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1005,6 +1005,14 @@ class Enum(metaclass=EnumType):
val = str(self)
# mix-in branch
else:
+ import warnings
+ warnings.warn(
+ "in 3.12 format() will use the enum member, not the enum member's value;\n"
+ "use a format specifier, such as :d for an IntEnum member, to maintain"
+ "the current display",
+ DeprecationWarning,
+ stacklevel=2,
+ )
cls = self._member_type_
val = self._value_
return cls.__format__(val, format_spec)