summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBeweeted <Beweeted@users.noreply.github.com>2022-12-11 23:20:59 (GMT)
committerGitHub <noreply@github.com>2022-12-11 23:20:59 (GMT)
commit868bab0fdc514cfa70ce97e484a689aee8cb5a36 (patch)
treef7260585d1df45e665a766b0732dcb8080fa9dcd /Doc
parent2e279e85fece187b6058718ac7e82d1692461e26 (diff)
downloadcpython-868bab0fdc514cfa70ce97e484a689aee8cb5a36.zip
cpython-868bab0fdc514cfa70ce97e484a689aee8cb5a36.tar.gz
cpython-868bab0fdc514cfa70ce97e484a689aee8cb5a36.tar.bz2
gh-100174: [Enum] Correct PowersOfThree example. (GH-100178)
Changed from multiples of 3 to powers of 3 to match the class name.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/enum.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 295152c..25a6e1f 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)