11import six
22
3- from bmemcached .client .constants import SOCKET_TIMEOUT
3+ from bmemcached .client .constants import PICKLE_PROTOCOL , SOCKET_TIMEOUT
44from bmemcached .compat import pickle
55from bmemcached .protocol import Protocol
66
@@ -18,17 +18,23 @@ class ClientMixin(object):
1818 but you can change it to any Python module that provides
1919 `compress` and `decompress` functions, such as `bz2`.
2020 :type compression: Python module
21+ :param socket_timeout: The timeout applied to memcached connections.
22+ :type socket_timeout: float
23+ :param pickle_protocol: The pickling protocol to use, 0-5. See
24+ https://docs.python.org/3/library/pickle.html#data-stream-format
25+ default is 0 (human-readable, original format).
26+ :type pickle_protocol: int
2127 :param pickler: Use this to replace the object serialization mechanism.
2228 :type pickler: function
2329 :param unpickler: Use this to replace the object deserialization mechanism.
2430 :type unpickler: function
25- :param socket_timeout: The timeout applied to memcached connections.
26- :type socket_timeout: float
2731 """
28- def __init__ (self , servers = ('127.0.0.1:11211' ,), username = None ,
29- password = None , compression = None ,
32+ def __init__ (self , servers = ('127.0.0.1:11211' ,),
33+ username = None ,
34+ password = None ,
35+ compression = None ,
3036 socket_timeout = SOCKET_TIMEOUT ,
31- pickle_protocol = 0 ,
37+ pickle_protocol = PICKLE_PROTOCOL ,
3238 pickler = pickle .Pickler ,
3339 unpickler = pickle .Unpickler ):
3440 self .username = username
0 commit comments