Allowed to pass arguments to the generator functions (optional)

This commit is contained in:
Priyansh Anand
2020-10-16 15:55:27 +05:30
parent e983077d92
commit f905903bd4

View File

@@ -15,8 +15,8 @@ class Generator:
def __str__(self):
return str(self.id) + " " + self.title + " " + self.generalProb + " " + self.generalSol
def __call__(self):
return self.func()
def __call__(self, **kwargs):
return self.func(**kwargs)
# || Non-generator Functions
def genById(id):