andymccurdy/redis-py — pull request #333 by kunalg (2013-04-14 17:41:47+00:00)
Title: Add support for storing pythonic objects in redis cache.

In the current code, Connection.encode() tries to call str() on the object
if it's _not_ an instance of basestring.

This forces the object to return serialized representation using ```__str__()```
override that is also fully de-serializable to be able to reconstruct the
object.

A better approach is to use standard python serialization protocol: pickle.

This patch uses cPickle (which is a much faster implementation of the pickle
protocol) to serialize/de-serialize the object.

NOTE: this works only with PythonParser for now - HiredisParser still needs
to be updated to try and de-serialize the object.

Signed-off-by: Kunal Gangakhedkar