Skip to content

Commit a2d718f

Browse files
hugorodgerbrownjaysonsantos
authored andcommitted
Update docstring for ClientMixin (#213)
* Update docstring for ClientMixin * Add python 3.7, 3.8 to tox and travis config
1 parent 6659fb6 commit a2d718f

4 files changed

Lines changed: 16 additions & 7 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ python:
44
- "3.4"
55
- "3.5"
66
- "3.6"
7+
- "3.7"
8+
- "3.8"
79
env:
810
- STEP=tests
911
- STEP=lint

bmemcached/client/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
PICKLE_PROTOCOL = 0
12
SOCKET_TIMEOUT = 3

bmemcached/client/mixin.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import six
22

3-
from bmemcached.client.constants import SOCKET_TIMEOUT
3+
from bmemcached.client.constants import PICKLE_PROTOCOL, SOCKET_TIMEOUT
44
from bmemcached.compat import pickle
55
from 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

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py34,py35,py36
2+
envlist = py27,py34,py35,py36,py37,py38
33
[testenv]
44
deps = -rrequirements_test.txt
55
commands = python setup.py develop

0 commit comments

Comments
 (0)