Let's say I have a Python constructor
def foo(a, b, c):
__def __init__(self, a, b, c):
self.a = a
self.b = b
self.c = c
and I have a list of inputs
bar = [a, b, c]
Is there a way I can call the constructor with just a list of inputs? Eg,
foobar = foo(bar)
Or would I need to make an entire wrapper function, such as:
def fooWrapper(inputList):
a = inputList[0]
b = inputList[1]
c = inputList[2]
return foo(a, b, c)
Assuming I cannot change neither the constructor nor the way I receive the inputs (as a list), is there a more simple way to do this than creating a wrapper?
Thank you.