diff --git a/spec.md b/spec.md index b99b3c6..789a371 100644 --- a/spec.md +++ b/spec.md @@ -2896,13 +2896,13 @@ function's definition, they nevertheless must appear before `*args` in a call to the function. ```python -def g(a, *args, b=2, c): +def g(a, *args, b, c = 2): print(a, b, c, args) -g(1, 3) # error: function g missing 1 argument (c) +g(1, 3) # error: function g missing 1 argument (b) g(1, *[4, 5], c=3) # error: keyword argument c may not follow *args -g(1, 4, c=3) # "1 2 3 (4,)" -g(1, c=3, *[4, 5]) # "1 2 3 (4, 5)" +g(1, 4, b=3) # "1 3 2 (4,)" +g(1, b=3, *[4, 5]) # "1 3 2 (4, 5)" ``` A non-variadic function may also declare keyword-only parameters,