Check if the given object is a file

def isFile(self):
        """ Check if the given object is a file
        """
        try:
            filetype = file
        except NameError:
            filetype = io.IOBase

        return self._wrap(type(self.obj) is filetype)