FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Enum] fix typo by ethanfurman · Pull Request #94158 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
16 changes: 8 additions & 8 deletions Lib/enum.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1205,21 +1205,21 @@ def __new__(cls, value):
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:
Expand All @@ -1233,7 +1233,7 @@ def _generate_next_value_(name, start, count, last_value):
DeprecationWarning,
stacklevel=3,
)
for v in last_value:
for v in last_values:
try:
return v + 1
except TypeError:
Expand Down Expand Up @@ -1389,7 +1389,7 @@ def _generate_next_value_(name, start, count, last_values):
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
Expand Down

Back | FazBrowse Home | New Git URL