bpo-34235: PyArg_ParseTupleAndKeywords: support required keyword arguments by msullivan · Pull Request #11834 · python/cpython

@msullivan

…ments

This adds a `@` glyph to the PyArg_ParseTupleAndKeywords that
specifies that subsequent arguments are required keyword-only
arguments. It must appear after `|` and `$`, and allows functions to
take all four combinations of positional/named-only
v. required/optional arguments.

The restriction that `@` only appear after `|` and `$` have already
appeared is because it substantially simplifies the state machine and
because `$` already only works properly when `|` is specified (though
this is not *checked*).