diff options
author | John Anderson <sontek@gmail.com> | 2015-06-19 23:48:49 -0700 |
---|---|---|
committer | John Anderson <sontek@gmail.com> | 2015-06-19 23:48:49 -0700 |
commit | ace2cd339207c9739ef5ee0d4412a930b9bf571c (patch) | |
tree | e43863ba20d2aca02d36f164cc59dbcf3c2a7433 /pymemcache | |
parent | 5a135c0f72e54f570da69872dc32a2b6c384e2ff (diff) | |
download | pymemcache-ace2cd339207c9739ef5ee0d4412a930b9bf571c.tar.gz |
Flake8/pep8 the code
Diffstat (limited to 'pymemcache')
-rw-r--r-- | pymemcache/client.py | 9 | ||||
-rw-r--r-- | pymemcache/fallback.py | 1 | ||||
-rw-r--r-- | pymemcache/serde.py | 9 |
3 files changed, 11 insertions, 8 deletions
diff --git a/pymemcache/client.py b/pymemcache/client.py index 3a09639..9b5ae2c 100644 --- a/pymemcache/client.py +++ b/pymemcache/client.py @@ -128,9 +128,9 @@ class Client(object): strings must be encoded (as UTF-8, for example) unless they consist only of ASCII characters that are neither whitespace nor control characters. - Values must have a __str__() method to convert themselves to a byte string. - Unicode objects can be a problem since str() on a Unicode object will - attempt to encode it as ASCII (which will fail if the value contains + Values must have a __str__() method to convert themselves to a byte + string. Unicode objects can be a problem since str() on a Unicode object + will attempt to encode it as ASCII (which will fail if the value contains code points larger than U+127). You can fix this will a serializer or by just calling encode on the string (using UTF-8, for instance). @@ -602,7 +602,8 @@ class Client(object): Args: delay: optional int, the number of seconds to wait before flushing, or zero to flush immediately (the default). - noreply: optional bool, True to not wait for the response (the default). + noreply: optional bool, True to not wait for the response + (the default). Returns: True. diff --git a/pymemcache/fallback.py b/pymemcache/fallback.py index 6eed4f5..d70d83c 100644 --- a/pymemcache/fallback.py +++ b/pymemcache/fallback.py @@ -42,6 +42,7 @@ Best Practices: old cluster before you switch away from FallbackClient. """ + class FallbackClient(object): def __init__(self, caches): assert len(caches) > 0 diff --git a/pymemcache/serde.py b/pymemcache/serde.py index 0b654b6..c7a00ee 100644 --- a/pymemcache/serde.py +++ b/pymemcache/serde.py @@ -21,9 +21,9 @@ except ImportError: from StringIO import StringIO -FLAG_PICKLE = 1<<0 -FLAG_INTEGER = 1<<1 -FLAG_LONG = 1<<2 +FLAG_PICKLE = 1 << 0 +FLAG_INTEGER = 1 << 1 +FLAG_LONG = 1 << 2 def python_memcache_serializer(key, value): @@ -46,6 +46,7 @@ def python_memcache_serializer(key, value): return value, flags + def python_memcache_deserializer(key, value, flags): if flags == 0: return value @@ -61,7 +62,7 @@ def python_memcache_deserializer(key, value, flags): buf = StringIO(value) unpickler = pickle.Unpickler(buf) return unpickler.load() - except Exception as e: + except Exception: logging.info('Pickle error', exc_info=True) return None |