Runtime Data Attributes

function.__kwdefaults__

Defaults for keyword-only parameters. None indicates no such defaults; changing the mapping changes omitted keyword arguments.

Formal Syntax & Structure

python syntaxpython
f.__kwdefaults__

Return Value

dict | None

Value exposed by this attribute; availability and mutability depend on the owner as described.

Working Example

Example Snippetpython
def f(*, limit=3): return limitprint(f.__kwdefaults__)
Python Reference