"""Normalize a list, tuple, or mapping annotation."""
if origin is list or annotation is list:
return _normalize_list(value, args[0] if args else Any, path=path)
if origin is tuple or annotation is tuple:
return _normalize_tuple(value, args, path=path)
if not isinstance(value, Mapping):
raise _fail(path, f"expected mapping, got {type(value).__name__}")
return dict(value)
def _coerce_class(value: object, annotation: object, *, path: str) -> object:
"""Normalize a value against a concrete class annotation."""