Skip to content

Commit 660d462

Browse files
authored
[3.11] gh-100174: Fix math in PowersOfThree example class.
Changed from multiples of 3 to powers of 3 to match the class name.
1 parent 2e279e8 commit 660d462

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/enum.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,12 @@ Data Types
310310
>>> class PowersOfThree(Enum):
311311
... @staticmethod
312312
... def _generate_next_value_(name, start, count, last_values):
313-
... return (count + 1) * 3
313+
... return 3 ** (count + 1)
314314
... FIRST = auto()
315315
... SECOND = auto()
316316
...
317317
>>> PowersOfThree.SECOND.value
318-
6
318+
9
319319

320320
.. method:: Enum.__init_subclass__(cls, **kwds)
321321

0 commit comments

Comments
 (0)