Es bastante simple. Escribe valores usando claves y tiempos de caducidad. Obtienes valores usando claves. Puede caducar las claves del sistema.
La mayoría de los clientes siguen las mismas reglas. Puede leer las instrucciones genéricas y las mejores prácticas en la página de inicio de Memcached .
Si realmente quieres profundizar en ello, miraría la fuente. Aquí está el comentario del encabezado:
"""
client module for memcached (memory cache daemon)
Overview
========
See U{the MemCached homepage<http://www.danga.com/memcached>} for more about memcached.
Usage summary
=============
This should give you a feel for how this module operates::
    import memcache
    mc = memcache.Client(['127.0.0.1:11211'], debug=0)
    mc.set("some_key", "Some value")
    value = mc.get("some_key")
    mc.set("another_key", 3)
    mc.delete("another_key")
    mc.set("key", "1")   # note that the key used for incr/decr must be a string.
    mc.incr("key")
    mc.decr("key")
The standard way to use memcache with a database is like this::
    key = derive_key(obj)
    obj = mc.get(key)
    if not obj:
        obj = backend_api.get(...)
        mc.set(key, obj)
    # we now have obj, and future passes through this code
    # will use the object from the cache.
Detailed Documentation
======================
More detailed documentation is available in the L{Client} class.
"""
     
                
mces el objeto Memcache Client, representa la conexión Memcached.memcache.Te aconsejo que uses
pylibmcen su lugar.Puede actuar como un reemplazo directo de python-memcache, pero mucho más rápido (como está escrito en C). Y puede encontrar documentación útil aquí .
Y a la pregunta, como pylibmc simplemente actúa como un reemplazo directo, aún puede consultar la documentación de pylibmc para su programación python-memcache.
fuente
pylibmcno funciona en Python 3.python-memcachedtampoco es compatible con Python 3. pylibmc se está preparando actualmente para un lanzamiento con soporte para Python 3apt-get install libmemcached-devy luegopip install pylibmcUna buena regla general: use el sistema de ayuda integrado en Python. Ejemplo a continuación ...
fuente
apt-get install python-memcacheque obtener el módulo.