I had a ObjectAction with a objects_arg (extra s), and the exception didnt help show what was wrong.
File "daf/actions.py", line 21, in __new__
cls.check_class_definition()
File "daf/actions.py", line 337, in check_class_definition
super().check_class_definition()
File "daf/actions.py", line 259, in check_class_definition
super().check_class_definition()
File "daf/actions.py", line 206, in check_class_definition
if not re.match(r'\w+', cls.name):
File "daf/utils.py", line 36, in __get__
return self.getter(owner)
File "daf/actions.py", line 49, in name
return arg.s()(cls.func).func.__name__
File "daf/utils.py", line 36, in __get__
return self.getter(owner)
File "daf/actions.py", line 144, in func
return cls.get_wrapper()(cls.callable)
File "daf/actions.py", line 139, in get_wrapper
return cls.wrapper
File "daf/utils.py", line 36, in __get__
return self.getter(owner)
File "daf/actions.py", line 314, in wrapper
daf.contrib.single_list(cls.object_arg),
File "arg/core.py", line 229, in __init__
super().__init__(eval(f'lambda {arg}: {arg}'), default=default)
File "<string>", line 1
lambda None: None
^
SyntaxError: invalid syntax
The check_class_definition class methods of these classes does the necessary check.
I'm not sure why it isnt being used to give a better error message sooner.
I had a
ObjectAction
with aobjects_arg
(extra s), and the exception didnt help show what was wrong.