def get_type_and_args(annotation) -> tuple:
    """From annotation name: T[T, args] extract type, args."""
    _type_args: tuple = tuple()
    # _type from `field: T` or `field: list[T]`
    _type = get_origin(annotation) or annotation
    if _type is Annotated:
        _type, *_type_args = get_args(annotation)
    else:
        _type_args = get_args(annotation)
    return _type, _type_args
From annotation name: T[T, args] extract type, args.
dynaconf/typed/utils.py