summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorRaphaël Vinot <raphael@vinot.info>2011-06-11 13:14:19 -0400
committerRaphaël Vinot <raphael@vinot.info>2011-06-11 13:14:19 -0400
commitf9d753a1c6be19a8ac53e66e9e10815a0317806c (patch)
tree7273a59d101f650bbcec843124b13f62d830cf25 /redis/client.py
parentb553fa7b701d49fdfe7ee30836a4fbc59cd199ee (diff)
downloadredis-py-f9d753a1c6be19a8ac53e66e9e10815a0317806c.tar.gz
add variadic versions of L/RPUSH
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/redis/client.py b/redis/client.py
index 7bb6dec..f404f48 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -592,9 +592,10 @@ class Redis(object):
"Remove and return the first item of the list ``name``"
return self.execute_command('LPOP', name)
- def lpush(self, name, value):
- "Push ``value`` onto the head of the list ``name``"
- return self.execute_command('LPUSH', name, value)
+ def lpush(self, name, *values):
+ "Push ``values`` onto the head of the list ``name``"
+ keys = list_or_args(name, values)
+ return self.execute_command('LPUSH', *keys)
def lpushx(self, name, value):
"Push ``value`` onto the head of the list ``name`` if ``name`` exists"
@@ -643,9 +644,10 @@ class Redis(object):
"""
return self.execute_command('RPOPLPUSH', src, dst)
- def rpush(self, name, value):
- "Push ``value`` onto the tail of the list ``name``"
- return self.execute_command('RPUSH', name, value)
+ def rpush(self, name, *values):
+ "Push ``values`` onto the tail of the list ``name``"
+ keys = list_or_args(name, values)
+ return self.execute_command('RPUSH', *keys)
def rpushx(self, name, value):
"Push ``value`` onto the tail of the list ``name`` if ``name`` exists"