Skip to content

Commit

Permalink
pythongh-100174: [Enum] Correct PowersOfThree example. (pythonGH-100178)
Browse files Browse the repository at this point in the history
Changed from multiples of 3 to powers of 3 to match the class name.
(cherry picked from commit 868bab0)

Co-authored-by: Beweeted <[email protected]>
  • Loading branch information
Beweeted authored and miss-islington committed Dec 11, 2022
1 parent 606adb4 commit 4ce43b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ 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)

Expand Down

0 comments on commit 4ce43b5

Please sign in to comment.