summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/enum.rst12
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 00f617e..6837b45 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -402,13 +402,15 @@ Data Types
in the member assignment will be passed; e.g.
>>> from enum import Enum
- >>> class MyIntEnum(Enum):
- ... SEVENTEEN = '1a', 16
+ >>> class MyIntEnum(int, Enum):
+ ... TWENTYSIX = '1a', 16
- results in the call ``int('1a', 16)`` and a value of ``17`` for the member.
+ results in the call ``int('1a', 16)`` and a value of ``26`` for the member.
- .. note:: When writing a custom ``__new__``, do not use ``super().__new__`` --
- call the appropriate ``__new__`` instead.
+ .. note::
+
+ When writing a custom ``__new__``, do not use ``super().__new__`` --
+ call the appropriate ``__new__`` instead.
.. method:: Enum.__repr__(self)