Did I find the right examples for you? yes no

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)
Replace existing key with value.

Like L{set}, but only stores in memcache if the key already exists.
The opposite of L{add}.

@return: Nonzero on success.
@rtype: int

src/t/o/tornado-memcached-sessions-HEAD/session.py   tornado-memcached-sessions(Download)
            session_data = raw_data = mc.get(session_id)
            if raw_data != None:
                mc.replace(session_id, raw_data, self.session_timeout, 0)
                session_data = pickle.loads(raw_data)
            if type(session_data) == type({}):

src/m/e/memcache-debug-panel-HEAD/test/__init__.py   memcache-debug-panel(Download)
        self.assertLastCall('add', add, 'simple add, exists')
        # replace
        self.assertTrue(client.replace(add, value), 'simple replace, exists')
        self.assertLastCall('replace', add, 'simple replace, exists')
        non_existent = 'non-existent'
        client.replace(non_existent, value)
        self.assertFalse(client.replace(non_existent, value), 

src/c/a/Cache-Debug-Toolbar-HEAD/test/__init__.py   Cache-Debug-Toolbar(Download)
        self.assertLastCall('add', add, 'simple add, exists')
        # replace
        self.assertTrue(client.replace(add, value), 'simple replace, exists')
        self.assertLastCall('replace', add, 'simple replace, exists')
        non_existent = 'non-existent'
        client.replace(non_existent, value)
        self.assertFalse(client.replace(non_existent, value),