From: Beweeted Date: Sun, 11 Dec 2022 23:20:59 +0000 (-0800) Subject: gh-100174: [Enum] Correct PowersOfThree example. (GH-100178) X-Git-Tag: v3.12.0a4~236 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=868bab0fdc514cfa70ce97e484a689aee8cb5a36;p=thirdparty%2FPython%2Fcpython.git gh-100174: [Enum] Correct PowersOfThree example. (GH-100178) Changed from multiples of 3 to powers of 3 to match the class name. --- diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 295152c69082..25a6e1f0b616 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -310,12 +310,12 @@ Data Types >>> class PowersOfThree(Enum): ... @staticmethod ... def _generate_next_value_(name, start, count, last_values): - ... return (count + 1) * 3 + ... return 3 ** (count + 1) ... FIRST = auto() ... SECOND = auto() ... >>> PowersOfThree.SECOND.value - 6 + 9 .. method:: Enum.__init_subclass__(cls, **kwds)