mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
gh-103056: [Enum] use staticmethod decorator for _gnv_ (GH-103231)
_gnv_ --> _generate_next_value_
This commit is contained in:
parent
c71756fa65
commit
810d365b5e
2 changed files with 4 additions and 0 deletions
|
|
@ -1146,6 +1146,7 @@ def __new__(cls, value):
|
|||
def __init__(self, *args, **kwds):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def _generate_next_value_(name, start, count, last_values):
|
||||
"""
|
||||
Generate the next value when not given.
|
||||
|
|
@ -1288,6 +1289,7 @@ def __new__(cls, *values):
|
|||
member._value_ = value
|
||||
return member
|
||||
|
||||
@staticmethod
|
||||
def _generate_next_value_(name, start, count, last_values):
|
||||
"""
|
||||
Return the lower-cased version of the member name.
|
||||
|
|
@ -1337,6 +1339,7 @@ def __reduce_ex__(self, proto):
|
|||
|
||||
_numeric_repr_ = repr
|
||||
|
||||
@staticmethod
|
||||
def _generate_next_value_(name, start, count, last_values):
|
||||
"""
|
||||
Generate the next value when not given.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue