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
In version 0.3.1 when user attempts to raise error in the __init__ method the effective error that gets printed is about missing self argument. Minimal example:
import fire
from fire.core import FireError
class Calc:
def __init__(self):
raise FireError('foo')
def add(self):
pass
if __name__ == "__main__":
fire.Fire(Calc)
python calc.py add
ERROR: The function received no value for the required argument: self
When executed interactively, the error is correct:
>>>import calc; import fire
>>>fire.Fire(calc.Calc)
ERROR: foo
The text was updated successfully, but these errors were encountered:
Today I've tried to create something like a filter in the _ParseArgs() function (core.py). This filter check if there is the keyword "self" in fn_args and the component is a class, so it remove "self" from fn_args and append it to fn_defaults (to do this I've converted fn_defaults to a list, I've appended "self" and I've reconverted it in a tuple), but this doesn't work. Tomorrow I'll try to find other solutions.
In version 0.3.1 when user attempts to raise error in the
__init__
method the effective error that gets printed is about missingself
argument. Minimal example:When executed interactively, the error is correct:
The text was updated successfully, but these errors were encountered: