summaryrefslogtreecommitdiffstats
path: root/Doc/library/enum.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/enum.rst')
-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 faeb94d..18b54a4 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -392,13 +392,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)