def invalidates_cache(fn):
    """
    Clears all cached properties after the decorated function is called.
    Useful when changing external (third-party) state that requires
    reverification. (e.g.: decorate a "modify_something" method with this.)
    """
    def wrapped(self, *args, **kwargs):
        r = fn(self, *args, **kwargs)
        self._cache = {}
        return r
    return wrapped