Skip to content

Commit

Permalink
Update docstring for ClientMixin (#213)
Browse files Browse the repository at this point in the history
* Update docstring for ClientMixin

* Add python 3.7, 3.8 to tox and travis config
  • Loading branch information
hugorodgerbrown authored and jaysonsantos committed Jan 7, 2020
1 parent 6659fb6 commit a2d718f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
env:
- STEP=tests
- STEP=lint
Expand Down
1 change: 1 addition & 0 deletions bmemcached/client/constants.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PICKLE_PROTOCOL = 0
SOCKET_TIMEOUT = 3
18 changes: 12 additions & 6 deletions bmemcached/client/mixin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import six

from bmemcached.client.constants import SOCKET_TIMEOUT
from bmemcached.client.constants import PICKLE_PROTOCOL, SOCKET_TIMEOUT
from bmemcached.compat import pickle
from bmemcached.protocol import Protocol

Expand All @@ -18,17 +18,23 @@ class ClientMixin(object):
but you can change it to any Python module that provides
`compress` and `decompress` functions, such as `bz2`.
:type compression: Python module
:param socket_timeout: The timeout applied to memcached connections.
:type socket_timeout: float
:param pickle_protocol: The pickling protocol to use, 0-5. See
https://docs.python.org/3/library/pickle.html#data-stream-format
default is 0 (human-readable, original format).
:type pickle_protocol: int
:param pickler: Use this to replace the object serialization mechanism.
:type pickler: function
:param unpickler: Use this to replace the object deserialization mechanism.
:type unpickler: function
:param socket_timeout: The timeout applied to memcached connections.
:type socket_timeout: float
"""
def __init__(self, servers=('127.0.0.1:11211',), username=None,
password=None, compression=None,
def __init__(self, servers=('127.0.0.1:11211',),
username=None,
password=None,
compression=None,
socket_timeout=SOCKET_TIMEOUT,
pickle_protocol=0,
pickle_protocol=PICKLE_PROTOCOL,
pickler=pickle.Pickler,
unpickler=pickle.Unpickler):
self.username = username
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,py36
envlist = py27,py34,py35,py36,py37,py38
[testenv]
deps = -rrequirements_test.txt
commands = python setup.py develop
Expand Down

0 comments on commit a2d718f

Please sign in to comment.