cache_magic/__init__.py
def _handle_cache_hit(info, var_value, var_folder_path, version):
        """
        If there was a cache hit, this handles the invalidation of the cache, if needed
        """
        if var_value:
            # if there is an expression and no info-file -> a new variable and nothing needs to be checked up front
            if str(info["version"]) != str(version):
                # Note: Version can be a string, a number or the content of a variable (which can by anything)
                if debug:
                    print("resetting because version mismatch")
                CacheCall.reset_folder(var_folder_path)
            elif info["expression_hash"] != CacheCall.hash_line(var_value):
                print("Warning! Expression has changed since last save, which was at " + str(info["store_date"]))
                print("To store a new value, change the version ('-v' or '--version')  ")
        else:
            if version != '' and info['version'] != version:
                # force a version
                raise CacheCallException(
                    "Forced version '" + str(version)
                    + "' could not be found, instead found version '"
                    + str(info['version']) + "'."
                    + "If you don't care about a specific version, leave out the version parameter. ")

        If there was a cache hit, this handles the invalidation of the cache, if needed
        
If there was a cache hit, this handles the invalidation of the cache, if needed
If there was a cache hit this handles the invalidation of the cache if needed
def _handle_cache_hit(info, var_value, var_folder_path, version):
        if var_value:
            if str(info["version"]) != str(version):
                if debug:
                    print("resetting because version mismatch")
                CacheCall.reset_folder(var_folder_path)
            elif info["expression_hash"] != CacheCall.hash_line(var_value):
                print("Warning! Expression has changed since last save, which was at " + str(info["store_date"]))
                print("To store a new value, change the version ('-v' or '--version')  ")
        else:
            if version != '' and info['version'] != version:
                raise CacheCallException(
                    "Forced version '" + str(version)
                    + "' could not be found, instead found version '"
                    + str(info['version']) + "'."
                    + "If you don't care about a specific version, leave out the version parameter. ")
def _handle_cache_hit ( info , var_value , var_folder_path , version ) : if var_value : if str ( info [ "version" ] ) != str ( version ) : if debug : print ( "resetting because version mismatch" ) CacheCall . reset_folder ( var_folder_path ) elif info [ "expression_hash" ] != CacheCall . hash_line ( var_value ) : print ( "Warning! Expression has changed since last save, which was at " + str ( info [ "store_date" ] ) ) print ( "To store a new value, change the version ('-v' or '--version')  " ) else : if version != '' and info [ 'version' ] != version : raise CacheCallException ( "Forced version '" + str ( version ) + "' could not be found, instead found version '" + str ( info [ 'version' ] ) + "'." + "If you don't care about a specific version, leave out the version parameter. " )
If there was a cache hit, this handles the invalidation of the cache, if needed
If there was a cache hit this handles the invalidation of the cache if needed
"""
        If there was a cache hit, this handles the invalidation of the cache, if needed
        """ # if there is an expression and no info-file -> a new variable and nothing needs to be checked up front # Note: Version can be a string, a number or the content of a variable (which can by anything) # force a version
info
var_value
var_folder_path
version