          except (ValueError, TypeError):
              self._cull_frequency = 3
  
      def get(self, key, default=None):
          now = time.time()
          exp = self._expire_info.get(key)
          if exp is None:
              return default
          elif exp < now:
 
</s>
    def add(self, key, value, timeout=None):
        if len(self._cache) >= self._max_entries:
            self._cull()
        if timeout is None:
            timeout = self.default_timeout
        if key not in self._cache.keys():
            self._cache[key] = value
            self._expire_info[key] = time.time() + timeout

          except (ValueError, TypeError):
              self._cull_frequency = 3
  
    def add(self, key, value, timeout=None):
        if len(self._cache) >= self._max_entries:
            self._cull()
        if timeout is None:
            timeout = self.default_timeout
        if key not in self._cache.keys():
            self._cache[key] = value
            self._expire_info[key] = time.time() + timeout

      def get(self, key, default=None):
          now = time.time()
          exp = self._expire_info.get(key)
          if exp is None:
              return default
          elif exp < now:
keep keep add keep keep keep keep keep keep
 Fixed #4831 -- Added an "add" cache key method, for parity with memcached's
API. This works for all cache backends. Patch from Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6572 bcc190cf-cafb-0310-a4f2-bffc1f526a37
django/core/cache/backends/simple.py