mirror of
https://github.com/python/cpython.git
synced 2025-11-09 01:51:26 +00:00
bpo-30616: Functional API of enum allows to create empty enums. (#2304)
* bpo-30616: Functional API of enum allows to create empty enums. * Update NEWS move addition to avoid conflict
This commit is contained in:
parent
5ff7132313
commit
dcc8ce44c7
3 changed files with 24 additions and 1 deletions
|
|
@ -381,7 +381,7 @@ def _create_(cls, class_name, names=None, *, module=None, qualname=None, type=No
|
|||
# special processing needed for names?
|
||||
if isinstance(names, str):
|
||||
names = names.replace(',', ' ').split()
|
||||
if isinstance(names, (tuple, list)) and isinstance(names[0], str):
|
||||
if isinstance(names, (tuple, list)) and names and isinstance(names[0], str):
|
||||
original_names, names = names, []
|
||||
last_values = []
|
||||
for count, name in enumerate(original_names):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue