def _read_file(self, filename):
        """
        read a Python object from a cache file.

        Reads a pickled object from disk and returns it.

        :param filename: Name of the file that should be read.
        :type filename: str
        :rtype: object
        """

        if self.__compression:
            f = gzip.GzipFile(filename, "rb")
        else:
            f = open(filename, "rb")
        res = pickle.load(f)
        f.close()
        return res
read a Python object from a cache file.

        Reads a pickled object from disk and returns it.

        :param filename: Name of the file that should be read.
        :type filename: str
        :rtype: object