Skip to main content

default

If value is unavailable, use given default.

def default(
value: any,
arg: any
) - > any

If value is unavailable, use given default.

Parameters

NameTypeDescription
valueanyThe initial value to be checked for existence or truthiness.
arganyThe fallback value to return if the initial value is unavailable or evaluates to False.

Returns

TypeDescription
anyThe original value if it evaluates to True, otherwise the provided default argument.