Skip to content

Commit 593c5a0

Browse files
gh-100174: [Enum] Correct PowersOfThree example. (GH-100178)
Changed from multiples of 3 to powers of 3 to match the class name. (cherry picked from commit 868bab0) Co-authored-by: Beweeted <Beweeted@users.noreply.github.com>
1 parent 606adb4 commit 593c5a0

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
@@ -316,11 +316,11 @@ Data Types
316316
>>> class PowersOfThree(Enum):
317317
... @staticmethod
318318
... def _generate_next_value_(name, start, count, last_values):
319-
... return (count + 1) * 3
319+
... return 3 ** (count + 1)
320320
... FIRST = auto()
321321
... SECOND = auto()
322322
>>> PowersOfThree.SECOND.value
323-
6
323+
9
324324

325325
.. method:: Enum.__init_subclass__(cls, **kwds)
326326

0 commit comments

Comments
 (0)