code: def cached_accessor(func_or_att):
      
      if callable(func_or_att): #allows decorator to be called without arguments
          att = func_or_att.__name__
          return cached_accessor(func_or_att.__name__)(func_or_att)
      att = func_or_att
      def make_cached_function(func):
          @wraps(func)
          def cached_check_version(self):
              private_att = '_'+att
              if getattr(self, private_att):
                  return getattr(self, private_att)
              setattr(self, private_att, self.load_key(att))
              if getattr(self, private_att):
                  return getattr(self, private_att)
              value = func(self)
              setattr(self, private_att, value)
              self.save_key(att, value)
              return value
          return cached_check_version
      return make_cached_function
docs: Decorated function checks in-memory cache and disc cache for att first