Skip to content
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

extend an IntEnum with documentation fails #20

Open
mvillion opened this issue Jun 10, 2022 · 0 comments
Open

extend an IntEnum with documentation fails #20

mvillion opened this issue Jun 10, 2022 · 0 comments

Comments

@mvillion
Copy link

Following the example from https://stackoverflow.com/questions/28126314/adding-members-to-python-enums
but using IntEnum instead of Enum, yield an error.

from aenum import IntEnum
from aenum import extend_enum

class ColorHelp(IntEnum):
     _init_ = 'value __doc__'
     black = 0, 'the absence of color'

extend_enum(ColorHelp, 'white', 1, 'the presence of every color')

Traceback (most recent call last):

File "/tmp/ipykernel_13921/3054020738.py", line 1, in <cell line: 1>
extend_enum(ColorHelp, 'white', 1, 'the presence of every color')

File "/usr/local/lib/python3.10/dist-packages/aenum/init.py", line 3572, in extend_enum
new_member = _new(enumeration, *args, **kwds)

ValueError: invalid literal for int() with base 10: 'the presence of every color'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant