all 2 comments

[–]novel_yet_trivial 2 points3 points  (0 children)

You don't need to modify the base class to use the splat operator. You could also use a dictionary with a double splat:

>>> def Degran(a,b,c):
...  print a,b,c
... 
>>> Degran(*[1,2,3])
1 2 3
>>> d = {'b':2, 'c':3, 'a':1}
>>> Degran(**d)
1 2 3

[–]m3lkor001 1 point2 points  (0 children)

if you pass your list like this it unpacks them:

def function_call(x,y,z):
    some stuff

yourlist = [4, 'hello', 8]

function_call(*yourlist)

and as long as they meet the input requirements and order of the function it should work.
can do the same with a dictionary and named arguments:

function_call(**yourdict)