Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Enum] fix typo#94158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanfurman merged 1 commit intopython:mainfromethanfurman:enum-last_values
Jun 23, 2022
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix typo
  • Loading branch information
@ethanfurman
ethanfurman committedJun 23, 2022
commit265987c220fc5f89ca61bf229f6402b2cb81079a
16 changes: 8 additions & 8 deletionsLib/enum.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 notlast_value:
if notlast_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 inlast_value:
for v inlast_values:
try:
return v + 1
except TypeError:
Expand DownExpand 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

[8]ページ先頭

©2009-2025 Movatter.jp