-
Notifications
You must be signed in to change notification settings - Fork 178
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
Make pickle version for python_memcache_serializer adjustable #190
Conversation
pymemcache/serde.py
Outdated
pickler.dump(value) | ||
value = output.getvalue() | ||
|
||
return value, flags | ||
|
||
|
||
def get_python_memcache_serializer_pickle_version(pickle_version=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be shortened to get_python_memcache_serializer()
, in case there are other reasonable parameters to provide in the future. That will keep the public API more stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, I am bad at naming things.
pymemcache/serde.py
Outdated
|
||
|
||
python_memcache_serializer = partial( | ||
_python_memcache_serializer, pickle_version=DEFAULT_PICKLE_VERSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could just call get_python_memcache_serializer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the new get_python_memcache_serializer
should be explained in the documentation.
It's unsafe to use the max pickle version when you are switching between versions of python with different max versions. Add a new function get_python_memcache_serializer that returns a python_memcache_serializer with any pickle version.
added a few lines to getting_started to cover the serde module |
It's unsafe to use the max pickle version when you are switching between
versions of python with different max versions.
Add a new function get_python_memcache_serializer_pickle_version that
returns a python_memcache_serializer with any pickle version.