<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def previous_key(self, cache_key):
 """If there was a previous successful build for the given key, return the previous key. :param cache_key: A CacheKey object (as returned by CacheKeyGenerator.key_for(). :returns: The previous cache_key, or None if there was not a previous build. """

    if not self.cacheable(cache_key):
      # We should never successfully cache an uncacheable CacheKey.
      return None

    previous_hash = self._read_sha(cache_key)
    if not previous_hash:
      return None
    return CacheKey(cache_key.id, previous_hash)