Skip to contents

Unwrap a decorated function

Usage

undecorate(f, depth = 1)

Arguments

f

A function possibly wrapped by one of the with_*() decorators.

depth

Positive number. How many wrapper layers to remove. Default 1; Inf unwraps completely, stopping at the innermost function.

Value

The function f with depth layers removed, or f unchanged if it is not a decorated function (or has fewer than depth layers).