Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
>>> p = PosixPath('~/films/Monty Python') >>> p.expanduser() PosixPath('/home/eric/films/Monty Python')
pathlib/Path.expanduser
Path.expanduser