summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-23 15:14:45 (GMT)
committerGitHub <noreply@github.com>2022-06-23 15:14:45 (GMT)
commit96a76141d52755ffda54fefc3c2c8da49e895e80 (patch)
tree2337f05ec7a37f3c71e76e4918a74ef4a8640d4e
parentcf3f8d4728d75d39c206bcadbd8780e366409ac1 (diff)
downloadcpython-96a76141d52755ffda54fefc3c2c8da49e895e80.zip
cpython-96a76141d52755ffda54fefc3c2c8da49e895e80.tar.gz
cpython-96a76141d52755ffda54fefc3c2c8da49e895e80.tar.bz2
[Enum] fix typo (GH-94158)
(cherry picked from commit b4e0d6124a848a22df1ba12891329242c9e96f11) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
-rw-r--r--Lib/enum.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 747a5578..d9efd0e 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1218,21 +1218,21 @@ class Enum(metaclass=EnumType):
def __init__(self, *args, **kwds):
pass
- def _generate_next_value_(name, start, count, last_value):
+ def _generate_next_value_(name, start, count, last_values):
"""
Generate the next value when not given.
name: the name of the member
start: the initial start value or None
count: the number of existing members
- last_value: the list of values assigned
+ last_values: the list of values assigned
"""
- if not last_value:
+ if not last_values:
return start
try:
- last = last_value[-1]
- last_value.sort()
- if last == last_value[-1]:
+ last = last_values[-1]
+ last_values.sort()
+ if last == last_values[-1]:
# no difference between old and new methods
return last + 1
else:
@@ -1246,7 +1246,7 @@ class Enum(metaclass=EnumType):
DeprecationWarning,
stacklevel=3,
)
- for v in last_value:
+ for v in last_values:
try:
return v + 1
except TypeError:
@@ -1402,7 +1402,7 @@ class Flag(Enum, boundary=STRICT):
name: the name of the member
start: the initial start value or None
count: the number of existing members
- last_value: the last value assigned or None
+ last_values: the last value assigned or None
"""
if not count:
return start if start is not None else 1