diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2023-04-04 00:47:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 00:47:40 (GMT) |
commit | 810d365b5eb2cf3043957ca2971f6e7a7cd87d0d (patch) | |
tree | c68dc1bf075c13aedf4a19d8714c17d58b9ddc08 /Lib | |
parent | c71756fa651e51041ac8b55776320e3297ba081d (diff) | |
download | cpython-810d365b5eb2cf3043957ca2971f6e7a7cd87d0d.zip cpython-810d365b5eb2cf3043957ca2971f6e7a7cd87d0d.tar.gz cpython-810d365b5eb2cf3043957ca2971f6e7a7cd87d0d.tar.bz2 |
gh-103056: [Enum] use staticmethod decorator for _gnv_ (GH-103231)
_gnv_ --> _generate_next_value_
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/enum.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py index 9d836c7..ec698d5 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -1146,6 +1146,7 @@ class Enum(metaclass=EnumType): 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 @@ class StrEnum(str, ReprEnum): 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 @@ class Flag(Enum, boundary=CONFORM): _numeric_repr_ = repr + @staticmethod def _generate_next_value_(name, start, count, last_values): """ Generate the next value when not given. |