I have a dataclass like this
@dataclass
class Pkg:
func: typing.Any
I have 3 funcs like
def func1(A, B, C):
# do something
def func2(A, P):
# do something
def func3(D):
# do something
I created a wrapper pkg for each function like this
pkg1 = Pkg(func=func1)
pkg2 = Pkg(func=func2)
pkg3 = Pkg(func=func3)
Then I'm trying to call each of these in another function like
def run_func(pkg, args):
pkg.func(args)
However, each of them take a different number of params, which is obscured by the wrapper function. What's the best way to write this?