From: Hugo van Kemenade Date: Fri, 19 May 2023 20:12:57 +0000 (+0300) Subject: [3.11] gh-104659: Consolidate python examples in enum documentation (#104665) (#104666) X-Git-Tag: v3.11.4~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd13f73afd042fddbb4c85a4b0466276e1d53735;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-104659: Consolidate python examples in enum documentation (#104665) (#104666) gh-104659: Consolidate python examples in enum documentation (#104665) (cherry picked from commit 3ac856e69734491ff8423020c700c9ae86ac9a08) Co-authored-by: Thomas Hisch --- diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 27400cf993c0..15b8e2918d75 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -404,17 +404,18 @@ Data Types with an *IntEnum* member, the resulting value loses its enumeration status. >>> from enum import IntEnum - >>> class Numbers(IntEnum): + >>> class Number(IntEnum): ... ONE = 1 ... TWO = 2 ... THREE = 3 - >>> Numbers.THREE - - >>> Numbers.ONE + Numbers.TWO + ... + >>> Number.THREE + + >>> Number.ONE + Number.TWO 3 - >>> Numbers.THREE + 5 + >>> Number.THREE + 5 8 - >>> Numbers.THREE == 3 + >>> Number.THREE == 3 True .. note::