def isdir(self):
        """
        Check if this L{FilePath} refers to a directory.

        @return: C{True} if this L{FilePath} refers to a directory, C{False}
            otherwise.
        @rtype: L{bool}
        """
        st = self._statinfo
        if not st:
            self.restat(False)
            st = self._statinfo
            if not st:
                return False
        return S_ISDIR(st.st_mode)

        Check if this L{FilePath} refers to a directory.

        @return: C{True} if this L{FilePath} refers to a directory, C{False}
            otherwise.
        @rtype: L{bool}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/filepath.py