diff options
author | andy <andy@whiskeymedia.com> | 2012-08-15 03:01:49 -0700 |
---|---|---|
committer | andy <andy@whiskeymedia.com> | 2012-08-15 03:01:49 -0700 |
commit | 37abcc788874393b391bd437d6a5b56f27cb136c (patch) | |
tree | a46fe5f68d1577b0332804a4711133e711ad6202 /redis/client.py | |
parent | 9fbbe592bb52543d46bd7dc66001d9b3f2b28064 (diff) | |
download | redis-py-37abcc788874393b391bd437d6a5b56f27cb136c.tar.gz |
adding SkipTests for BITOP/BITCOUNT commands below redis 2.6, fixing logic to work with python32.6.2
Diffstat (limited to 'redis/client.py')
-rw-r--r-- | redis/client.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/redis/client.py b/redis/client.py index 481ffa6..39b6c42 100644 --- a/redis/client.py +++ b/redis/client.py @@ -455,20 +455,23 @@ class StrictRedis(object): def bitcount(self, key, start=None, end=None): """ - returns the count of set bits in the given (string) key. Optional - start and end params indicate which _bytes_ to consider + Returns the count of set bits in the value of ``key``. Optional + ``start`` and ``end`` paramaters indicate which bytes to consider """ params = [key] if start and end: - params.append(start) - params.append(end) + params.append(start) + params.append(end) elif (start and not end) or (end and not start): - raise RedisError("Both start and end must be specified") + raise RedisError("Both start and end must be specified") return self.execute_command('BITCOUNT', *params) - def bitop(self, op, dest, *keys): - return self.execute_command('BITOP', op, dest, *keys) - + def bitop(self, operation, dest, *keys): + """ + Perform a bitwise operation using ``operation`` between ``keys`` and + store the result in ``dest``. + """ + return self.execute_command('BITOP', operation, dest, *keys) def decr(self, name, amount=1): """ |