You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an undefined variable name undefined in _enum.py causing errors if there are not enough arguments given to extend_enum (might be in other cases too but haven't tested)
To recreate:
from aenum import Enum, extend_enum
class MyEnum(Enum, init="var1 var2"):
pass
extend_enum(MyEnum, "NEW_MEMBER", "my_var1")
Output:
Traceback (most recent call last):
...
File "...\aenum\_enum.py", line 2722, in extend_enum
new_member.__init__(*args)
File "...\aenum\_enum.py", line 2203, in __init__
value = kwds.pop(name, undefined)
NameError: name 'undefined' is not defined
Relevant lines from __init__ of _enum.py:
2200 if len(args) < len(_auto_init_):
2201 remaining_args = _auto_init_[len(args):]
2202 for name in remaining_args:
2203 value = kwds.pop(name, undefined)
2204 if value is undefined:
2205 raise TypeError('missing value for: %r' % (name, ))
2206 setattr(self, name, value)
The text was updated successfully, but these errors were encountered:
There is an undefined variable name
undefined
in _enum.py causing errors if there are not enough arguments given toextend_enum
(might be in other cases too but haven't tested)To recreate:
Output:
Relevant lines from
__init__
of _enum.py:The text was updated successfully, but these errors were encountered: