diff options
| author | Itamar Haber <itamar@redislabs.com> | 2018-10-05 18:16:44 +0300 |
|---|---|---|
| committer | Itamar Haber <itamar@redislabs.com> | 2018-10-05 18:16:44 +0300 |
| commit | b275920e86611ad6bf80d717dd5d327f47a8c374 (patch) | |
| tree | 52455997e72b18ccfeda6cd60224d94b01104b6d | |
| parent | 5ad0df5e61a90a14104c1174cce33743bae766fc (diff) | |
| download | redis-py-b275920e86611ad6bf80d717dd5d327f47a8c374.tar.gz | |
PEP8's it
Signed-off-by: Itamar Haber <itamar@redislabs.com>
| -rwxr-xr-x | redis/client.py | 21 | ||||
| -rw-r--r-- | tests/test_commands.py | 4 |
2 files changed, 16 insertions, 9 deletions
diff --git a/redis/client.py b/redis/client.py index e5328c5..5b86dc3 100755 --- a/redis/client.py +++ b/redis/client.py @@ -394,7 +394,8 @@ class StrictRedis(object): 'ZPOPMAX ZPOPMIN ZRANGE ZRANGEBYSCORE ZREVRANGE ZREVRANGEBYSCORE', zset_score_pairs ), - string_keys_to_dict('BZPOPMIN BZPOPMAX', lambda r: r and (r[0], r[1], float(r[2])) or None), + string_keys_to_dict('BZPOPMIN BZPOPMAX', \ + lambda r: r and (r[0], r[1], float(r[2])) or None), string_keys_to_dict('ZRANK ZREVRANK', int_or_none), string_keys_to_dict('BGREWRITEAOF BGSAVE', lambda r: True), { @@ -1730,7 +1731,10 @@ class StrictRedis(object): return self.execute_command('ZLEXCOUNT', name, min, max) def zpopmax(self, name, count=None): - "Remove and return up to ``count`` members with the highest scores from the sorted set ``name``" + """ + Remove and return up to ``count`` members with the highest scores + from the sorted set ``name``. + """ args = (count is not None) and [count] or [] options = { 'withscores': True @@ -1738,7 +1742,10 @@ class StrictRedis(object): return self.execute_command('ZPOPMAX', name, *args, **options) def zpopmin(self, name, count=None): - "Remove and return up to ``count`` members with the lowest scores from the sorted set ``name``" + """ + Remove and return up to ``count`` members with the lowest scores + from the sorted set ``name``. + """ args = (count is not None) and [count] or [] options = { 'withscores': True @@ -1750,8 +1757,8 @@ class StrictRedis(object): ZPOPMAX a value off of the first non-empty sorted set named in the ``keys`` list. - If none of the sorted sets in ``keys`` has a value to ZPOPMAX, - then block for ``timeout`` seconds, or until a member gets added + If none of the sorted sets in ``keys`` has a value to ZPOPMAX, + then block for ``timeout`` seconds, or until a member gets added to one of the sorted sets. If timeout is 0, then block indefinitely. @@ -1770,8 +1777,8 @@ class StrictRedis(object): ZPOPMIN a value off of the first non-empty sorted set named in the ``keys`` list. - If none of the sorted sets in ``keys`` has a value to ZPOPMIN, - then block for ``timeout`` seconds, or until a member gets added + If none of the sorted sets in ``keys`` has a value to ZPOPMIN, + then block for ``timeout`` seconds, or until a member gets added to one of the sorted sets. If timeout is 0, then block indefinitely. diff --git a/tests/test_commands.py b/tests/test_commands.py index a470cad..c7c31c2 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -977,7 +977,7 @@ class TestRedisCommands(object): # with count assert r.zpopmax('a', count=2) == \ - [(b('a2'), 2), (b('a1'), 1)] + [(b('a2'), 2), (b('a1'), 1)] @skip_if_server_version_lt('4.9.0') def test_zpopmin(self, r): @@ -987,7 +987,7 @@ class TestRedisCommands(object): # with count assert r.zpopmin('a', count=2) == \ - [(b('a2'), 2), (b('a3'), 3)] + [(b('a2'), 2), (b('a3'), 3)] @skip_if_server_version_lt('4.9.0') def test_bzpopmax(self, r): |
