From cc7d2bfed697ec11d2624f7a1273a761f317436e Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Fri, 19 May 2023 19:46:20 +0200 Subject: [PATCH] gh-104659: Consolidate python examples in enum documentation (#104665) (cherry picked from commit 3ac856e69734491ff8423020c700c9ae86ac9a08) --- Doc/library/enum.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 27400cf993c092..15b8e2918d7544 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:: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy