(self)
A context manager to allow modification of the cache. It will restore the previous value
        on any error.
        Usage:
        ```
            with cache.update():
                cache.set_XXX(SOME_DATA)
        ```
A context manager to allow modification of the cache. It will restore the previous value
        on any error.
        Usage:
        ```
            with cache.update():
                cache.set_XXX(SOME_DATA)
        ```
A context manager to allow modification of the cache . It will restore the previous value on any error . Usage : with cache . update () : cache . set_XXX ( SOME_DATA )
def update(self):
        # type: () -> Generator[None, None, None]
        """A context manager to allow modification of the cache. It will restore the previous value
        on any error.
        Usage:
        ```
            with cache.update():
                cache.set_XXX(SOME_DATA)
        ```
        """
        old_content = self._content
        self._content = {}  # 1. clear the content
        try:
            yield  # 2. Actually update the cache
            self._last_ts = time.time()  # 3. Cache was updated successfully
        except Exception:
            # Restore old data
            self._content = old_content
            raise
def update ( self ) : # type: () -> Generator[None, None, None] old_content = self . _content self . _content = { } # 1. clear the content try : yield # 2. Actually update the cache self . _last_ts = time . time ( ) # 3. Cache was updated successfully except Exception : # Restore old data self . _content = old_content raise