def expanduser(self):
    """ Return a new path with expanded ~ and ~user constructs
    (as returned by os.path.expanduser)
    """
return self.__class__(os.path.expanduser(str(self)))
Получение домашнего каталога с помощью pathlib