Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pickling Support #186

Closed
dlo opened this issue Aug 27, 2011 · 2 comments
Closed

Pickling Support #186

dlo opened this issue Aug 27, 2011 · 2 comments

Comments

@dlo
Copy link

dlo commented Aug 27, 2011

Maybe I'm missing something, but there's no support for pickling (as in the memcached library) as far as I can tell.

This is a pretty standard piece of functionality, and it breaks a lot of things that would be expected to work. E.g.

>>> data = {"name": "Bill"}
>>> type(data)
<type 'dict'>
>>> r.set("key", data)
>>> result = r.get("key")
>>> type(result)
<type 'str'>

Did I miss something in the documentation?

@andymccurdy
Copy link
Contributor

You didn't miss anything in the docs. redis-py does not pickle things by default because of the performance costs of doing so. If you need pickling support, I'd suggest subclasses the main Redis class (or StrictRedis if you prefer that), and override get/set.

@dlo
Copy link
Author

dlo commented Aug 28, 2011

Awesome, thanks!

@dlo dlo closed this as completed Aug 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants