default argument

A value a function uses for a parameter when the caller leaves that parameter out.

In more detail

Changing a default silently changes the behaviour for every caller that relied on it. An optional parameter with a default of None is also a common seam: production callers omit it, and tests pass in a fixed clock or generator.

Example

def with_vat(amount, rate=20):

Related terms

Taught in

References