zut.typing.get_base_type

zut.typing.get_base_type(arg: type | UnionType | inspect.Parameter) type | None

Get the base type associated to an annotation.

Parameters:

arg – A type (typically coming from inspect.get_annotations(…, eval_str=True)) or a parameter (typically coming from inspect.signature(…).parameters).