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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use functional API to create enum with zero values #74801
Comments
The OO API allows to create empty enums, i.e. without any values. However, the functional API does not, as this will result in an IndexError as shown below: In [1]: import enum In [2]: class X(enum.IntFlag): pass In [3]: Y = enum.IntFlag("Y", []) IndexError Traceback (most recent call last)
<ipython-input-3-1fda5945e0b2> in <module>()
----> 1 Y = enum.IntFlag("Y", []) ~/lib/python3.6/enum.py in __call__(cls, value, names, module, qualname, type, start) ~/lib/python3.6/enum.py in _create_(cls, class_name, names, module, qualname, type, start) IndexError: list index out of range |
3.7 fixed, now need 3.6. |
Thanks for the bugreport Gerrit Holl and thanks for fixes Dong-hee Na! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: