The way you defined the function:

def a(a = 1, b = 2, c = 3, *d, **e):
        print(a, b, c)
        print(d)
        print(e)

a, b and c are positional arguments. d will be filled with the excess arguments 
and e will receive a dictionary, if supplied.

One thing is the function definition, another is the function call. If you pass 
a number of arguments, the first three will be assigned to a, b and c no matter 
what, even if you supplied defaults.

Peter's solution turns a, b and c into keyword arguments. That way you can call 
the function with an arbitrary number of arguments and a, b and c will keep the 
default values, unless you be explicit about the values you want to assign to 
a, b and c.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to