From 18aa94875205bd8e9394e204e6df6971ed16eac4 Mon Sep 17 00:00:00 2001 From: Rohan-Salwan Date: Fri, 3 Dec 2021 16:07:16 +0530 Subject: [PATCH] Fix issue295 --- fire/helptext.py | 12 ++++++------ go.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 go.py diff --git a/fire/helptext.py b/fire/helptext.py index e91afbc9..d12b7f66 100644 --- a/fire/helptext.py +++ b/fire/helptext.py @@ -124,12 +124,12 @@ def ReturnAllArgs(Inherit_classes_list): Return: list of all arguments which is retrieved from parent classes. """ all_args = [] - if len(Inherit_classes_list)>2: - for classes in Inherit_classes_list: - argspec_tuple=inspect.getargspec(classes) - args_list=argspec_tuple[0] - for arg in args_list[1:]: - all_args.append(arg) + + for classes in Inherit_classes_list: + argspec_tuple=inspect.getargspec(classes) + args_list=argspec_tuple[0] + for arg in args_list[1:]: + all_args.append(arg) return all_args diff --git a/go.py b/go.py new file mode 100644 index 00000000..0e8c8bd3 --- /dev/null +++ b/go.py @@ -0,0 +1,46 @@ +import fire + +class D: + def __init__(self,cool,**kw): + for e in kw: + print(e,cool) + self.cool=cool + def shit(self,sh,jp): + print(sh,jp) + def oye(self,oy): + print(oy) + def job(self,low): + print(low) +class A(D): + + def __init__(self, name,**kw): + super().__init__(**kw) + self.name = name + + def gob(self,lobby): + self.lobby=lobby + + def girl(self,rob): + print(rob) + + def __str__(self): + return self.name + + def strange(self,kk): + print(kk) + +class B(A): + + def __init__(self, number, **kw): + super().__init__(**kw) + self.number = number + def boy(self,champ): + print(champ) + def lol(self,gol): + print(gol) + def __call__(self): + print(f"{self.name} + {self.number}+{self.cool}+{self.lobby}") + + +if __name__ == "__main__": + fire.Fire(B) \ No newline at end of file