Runtime Data Attributes

function.__defaults__

Defaults for the trailing positional parameters; None if absent. Replacing the tuple changes later calls that omit those arguments.

Formal Syntax & Structure

python syntaxpython
f.__defaults__

Return Value

tuple | None

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

Working Example

Example Snippetpython
def f(a, b=3): return a+bprint(f.__defaults__)
Python Reference