pylibmc 0.8
It's that time again — pylibmc release time! The memcached client library all true Pythonistas must have.
This fine release brings two new amazingly useful features, one is pooling and one is the binary protocol.
The pooling is implemented in pure Python, and is described in detail in previous posts, and is immensely useful.
The other feature, the binary protocol, is all from the TangentOrg guys really, I just added an interface to it (that's what I do, so hey). Quite easily:
import pylibmc mc = pylibmc.Client(["127.0.0.1"], binary=True) vals = mc.get_multi(("abc", "def", "ghi"))
pylibmc 0.8.2 at PyPI
Yeah, I did it again - missed files in the manifest. But I've worked up a solution, so it won't happen again. :-)
Also, works fine with libmemcached 0.33.
Hi
I am immensely enjoying your pylibmc module.
I have two questions for you.
1. exception handling.
except _pylibmc.MemcachedError, e:
raise
does not work at all. My app should not exit at all. I need to filter out exact libmemcached error or pylibmc error.
2. Blank value set
you should be able to do mc.set("blank", "")
mc.get("blank")
libmemcached does allow this as well.
But this raise an exception.
Thank you.
I just switched from the older pure python memcached interface to pylibmc, and I'm very happy with the change.
Two things bit me during the switch:
1. The original python memcached Client class constructor takes a pickelProtocol argument that defaults to zero. Pylibmc currently doesn't let callers specify the pickle protocol and has a different default. It would be nice if the pylibmc Client constructor accepted the same parameter, even if the default was different. That would let me ensure the pickle format doesn't change even under newer versions of python.
2. As Chang mentioned the pylibmc set/set_multi functions don't allow empty values.
Exception handling: Working on that, will produce an exception per error return code in libmemcached.
Pickle protocol: Fair point, will look into.
get with empty values: Obviously a bug, which I just fixed. See http://github.com/lericson/pylibmc/commit/343286a34ba1f4c9f7e6d0962233493fe24bafe5
