argclz.types.union_type#

argclz.types.union_type(*t)[source]#

Caster that tries multiple converters in order until one succeeds.

Parameters:

t (Callable[[str], T]) – converter functions to attempt

Returns:

function that returns first successful conversion

Raises:

TypeError – if all converters fail