The following code in python2.6 throws syntax error
>>> def f(a,*args,c):
File \"\", line 1
def f(a,*args,c):
^
Another way to emulate keyword-only-arguments is:
def f(a, *args, **kwds):
b = kwds.get('b', 42) # 42 being the default for b
if you wan't to make sure that no unsolicited arguments are passed you can use pop instead:
def f(a, *args, **kwds):
b = kwds.pop('b', 42)
assert not kwds # after we've popped all keywords arguments kwds should be empty