def isfile(self):
        """
        Check if this file path refers to a regular file.

        @return: C{True} if this L{FilePath} points to a regular file (not a
            directory, socket, named pipe, etc), 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_ISREG(st.st_mode)

        Check if this file path refers to a regular file.

        @return: C{True} if this L{FilePath} points to a regular file (not a
            directory, socket, named pipe, etc), C{False} otherwise.
        @rtype: L{bool}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/filepath.py