def realpath(self):
        """
        Returns the absolute target as a L{FilePath} if self is a link, self
        otherwise.

        The absolute link is the ultimate file or directory the
        link refers to (for instance, if the link refers to another link, and
        another...).  If the filesystem does not support symlinks, or
        if the link is cyclical, raises a L{LinkError}.

        Behaves like L{os.path.realpath} in that it does not resolve link
        names in the middle (ex. /x/y/z, y is a link to w - realpath on z
        will return /x/y/z, not /x/w/z).

        @return: L{FilePath} of the target path.
        @rtype: L{FilePath}
        @raises LinkError: if links are not supported or links are cyclical.
        """
        if self.islink():
            result = os.path.realpath(self.path)
            if result == self.path:
                raise LinkError("Cyclical link - will loop forever")
            return self.clonePath(result)
        return self

        Returns the absolute target as a L{FilePath} if self is a link, self
        otherwise.

        The absolute link is the ultimate file or directory the
        link refers to (for instance, if the link refers to another link, and
        another...).  If the filesystem does not support symlinks, or
        if the link is cyclical, raises a L{LinkError}.

        Behaves like L{os.path.realpath} in that it does not resolve link
        names in the middle (ex. /x/y/z, y is a link to w - realpath on z
        will return /x/y/z, not /x/w/z).

        @return: L{FilePath} of the target path.
        @rtype: L{FilePath}
        @raises LinkError: if links are not supported or links are cyclical.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/filepath.py