From 79ff9b271a58b844078957f54dca784f60d191fa Mon Sep 17 00:00:00 2001 From: Thomas Hisch Date: Fri, 19 May 2023 18:55:29 +0200 Subject: [PATCH] Consolidate python examples in enum documentation The IntEnum example in the rst docs is the only example in which a plural classname (Numbers) is used. This change fixes it by renaming Numbers to Number. Closes #104659 --- Doc/library/enum.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 582e06261afd72..e9c4f0e2c5f59b 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -406,18 +406,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