summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2010-05-23 07:39:44 -0700
committerAndy McCurdy <andy@andymccurdy.com>2010-05-23 07:39:44 -0700
commitdd8421273d4b17adfda56e8b753bdf92d4d43fb5 (patch)
tree3c0517172f1ecf62dedb4df671a5b4e16f66a5a9 /redis/client.py
parent2b07bd7ad65d4fdee11e1a3dba65180dd920cf75 (diff)
downloadredis-py-dd8421273d4b17adfda56e8b753bdf92d4d43fb5.tar.gz
renamed zinter/zunion to zinterstore/zunionstore to stay consistent with Redis.
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py
index d6932d1..eb58657 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -925,12 +925,18 @@ class Redis(threading.local):
return self.execute_command('ZINCRBY', name, amount, value)
def zinter(self, dest, keys, aggregate=None):
+ warnings.warn(DeprecationWarning(
+ "Redis.zinter has been deprecated, use Redis.zinterstore instead"
+ ))
+ return self.zinterstore(dest, keys, aggregate)
+
+ def zinterstore(self, dest, keys, aggregate=None):
"""
Intersect multiple sorted sets specified by ``keys`` into
a new sorted set, ``dest``. Scores in the destination will be
aggregated based on the ``aggregate``, or SUM if none is provided.
"""
- return self._zaggregate('ZINTER', dest, keys, aggregate)
+ return self._zaggregate('ZINTERSTORE', dest, keys, aggregate)
def zrange(self, name, start, end, desc=False, withscores=False):
"""
@@ -1017,12 +1023,18 @@ class Redis(threading.local):
return self.execute_command('ZSCORE', name, value)
def zunion(self, dest, keys, aggregate=None):
+ warnings.warn(DeprecationWarning(
+ "Redis.zunion has been deprecated, use Redis.zunionstore instead"
+ ))
+ return self.zunionstore(dest, keys, aggregate)
+
+ def zunionstore(self, dest, keys, aggregate=None):
"""
Union multiple sorted sets specified by ``keys`` into
a new sorted set, ``dest``. Scores in the destination will be
aggregated based on the ``aggregate``, or SUM if none is provided.
"""
- return self._zaggregate('ZUNION', dest, keys, aggregate)
+ return self._zaggregate('ZUNIONSTORE', dest, keys, aggregate)
def _zaggregate(self, command, dest, keys, aggregate=None):
pieces = [command, dest, len(keys)]