from typing import Any
from functools import reduce


def dgetattr(obj: Any, attr: str, default: Any) -> Any:
    """ getattr with dot seperated attribute list """
    try:
        return reduce(getattr, attr.split("."), obj)
    except AttributeError:
        return default