Skip to content

Commit

Permalink
gh-100174: [Enum] Correct PowersOfThree example. (GH-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 <Beweeted@users.noreply.github.com>
  • Loading branch information
miss-islington and Beweeted authored Dec 11, 2022
1 parent 606adb4 commit 593c5a0
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 593c5a0

Please sign in to comment.