0

I have this code:

class Test(CqlEngineModel):
     @classmethod
     @cql_engine_connector
     @functools.lru_cache(maxsize=1000)
     def is_not_analyzable(cls, x, y):
        if mic:
           query_result = ...
           mic_list = cls._to_list(query_result)   
           return True if mic_list else False
        else:
           return False

Outside I need to call cache_clear function, like this:

Test.is_not_analyzable.cache_clear()

but I have this error:

AttributeError: 'function' object has no attribute 'cache_clear
Guille
  • 23
  • 2
  • Does this answer your question, [clear cache of @property methods python](https://stackoverflow.com/questions/55497353/clear-cache-of-property-methods-python) – Federico Baù Jan 05 '21 at 12:46
  • 1
    @Federico Yes and no. This very much depends on the details of the outer decorators, and the duplicate does *not* explain how to access the decorated function of `cql_engine_connector` nor `classmethod`… – deceze Jan 05 '21 at 12:50

0 Answers0