<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def needs_update(self, cache_key):
 """Check if the given cached item is invalid. :param cache_key: A CacheKey object (as returned by CacheKeyGenerator.key_for(). :returns: True if the cached version of the item is out of date. """

    if not self.cacheable(cache_key):
      # An uncacheable CacheKey is always out of date.
      return True

    return self._read_sha(cache_key) != cache_key.hash