forcing keyword arguments in python 2.7
问题 I know I can use * to force all keyword arguments to a function/method to be "named". If I have def abc(a, *, x=10, z=30): pass then the following all work abc(5) abc(8, x=12) abc(9, z=31) abc(x=17, a=4) even if I change the function signature to def abc(a, *, x=10, y=20, z=30) , and abc(7, 13) throws an error. This is extremely important because, I can use the logical place, which will help maintenance over time, without being forced to use the end position based on history. But * is not