def __init__(*args, **kwargs):
    required_args = ['a', 'b']
ordered_args = ['a', 'b', 'c', 'd', 'e']
default_args = {'c': 0, 'd': 1, 'e': 2}
for index, value in enumerate(args):
    kwargs[ordered_args[index]] = value
for arg in required_args:
    if arg not in kwargs:
        raise TypeError('Argument %s is required' % arg)
for arg in default_args:
    if arg not in kwargs:
        kwargs[arg] = default_args[arg]
How to get __init__() to raise a more useful exception instead of TypeError when incorrect # of arguments?