( {' ' ' ' anywhere in keywords def (ac= * ** )print(abcdc is not keyword-only heref( = ( , {' ' in factsimilar ordering rules hold true in function callswhen keyword-only arguments are passedthey must appear before **args form the keyword-only argument can be coded either before or after the *argsthoughand may be included in **argsdef ( *bc= ** )print(abcdkw-only between and * ( *( )**dict( = = ) ( {' ' ' ' unpack args at call ( *( )**dict( = = ) = syntaxerrorinvalid syntax keywords before **argsf( *( ) = **dict( = = ) ( {' ' ' ' override default ( = *( )**dict( = = ) ( {' ' ' ' after or before ( *( )**dict( = = = ) ( {' ' ' ' keyword-only in *trace through these cases on your ownin conjunction with the general argumentordering rules described formally earlier they may appear to be worst cases in the artificial examples herebut they can come up in real practiceespecially for people who write libraries and tools for other python programmers to use why keyword-only argumentsso why care about keyword-only argumentsin shortthey make it easier to allow function to accept both any number of positional arguments to be processedand configuration options passed as keywords while their use is optionalwithout keywordonly arguments extra work may be required to provide defaults for such options and to verify that no superfluous keywords were passed imagine function that processes set of passed-in objects and allows tracing flag to be passedprocess(xyzprocess(xynotify=trueuse flag' default override flag default without keyword-only arguments we have to use both *args and **args and manually inspect the keywordsbut with keyword-only arguments less code is required the following guarantees that no positional argument will be incorrectly matched against notify and requires that it be keyword if passedspecial argument-matching modes