Skip to content

Commit

Permalink
Merge pull request #113 from timgraham/return
Browse files Browse the repository at this point in the history
Remove unnecessary parentheses in return statements
  • Loading branch information
linsomniac authored Dec 17, 2016
2 parents 5f69ec8 + 48f9610 commit d6a7a49
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@


def cmemcache_hash(key):
return (
(((binascii.crc32(key) & 0xffffffff)
>> 16) & 0x7fff) or 1)
return (((binascii.crc32(key) & 0xffffffff) >> 16) & 0x7fff) or 1
serverHashFunction = cmemcache_hash


Expand Down Expand Up @@ -343,7 +341,7 @@ def get_stats(self, stat_args=None):
stats = line.decode('ascii').split(' ', 2)
serverData[stats[1]] = stats[2]

return(data)
return data

def get_slab_stats(self):
data = []
Expand Down Expand Up @@ -1012,7 +1010,7 @@ def _val_to_store_info(self, val, min_compress_len):
# silently do not store if value length exceeds maximum
if (self.server_max_value_length != 0 and
len(val) > self.server_max_value_length):
return(0)
return 0

return (flags, len(val), val)

Expand All @@ -1033,7 +1031,7 @@ def _unsafe_set():

store_info = self._val_to_store_info(val, min_compress_len)
if not store_info:
return(0)
return 0
flags, len_val, encoded_val = store_info

if cmd == 'cas':
Expand All @@ -1048,8 +1046,7 @@ def _unsafe_set():
server.send_cmd(fullcmd)
if noreply:
return True
return(server.expect(b"STORED", raise_exception=True)
== b"STORED")
return server.expect(b"STORED", raise_exception=True) == b"STORED"
except socket.error as msg:
if isinstance(msg, tuple):
msg = msg[1]
Expand Down

0 comments on commit d6a7a49

Please sign in to comment.