summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2013-04-28 08:36:26 -0700
committerAndy McCurdy <andy@andymccurdy.com>2013-04-28 08:36:26 -0700
commit8270f91cbeb197c321ba91795772cf6f326de660 (patch)
tree1b730e3b4e4539443fddb0314a83ec01284d1b2d
parent07990bccb5969154cb1fc01fedf7265bb950e2d7 (diff)
parentd082f0fe3985a36d6a5705d6fd3365a7d573d1f8 (diff)
downloadredis-py-8270f91cbeb197c321ba91795772cf6f326de660.tar.gz
Merge pull request #343 from cypreess/master
Fixing INCRBY inconsistent naming
-rw-r--r--redis/client.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py
index 2964aa7..234b140 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -614,6 +614,16 @@ class StrictRedis(object):
"""
return self.execute_command('INCRBY', name, amount)
+ def incrby(self, name, amount=1):
+ """
+ Increments the value of ``key`` by ``amount``. If no key exists,
+ the value will be initialized as ``amount``
+ """
+
+ # An alias for ``incr()``, because it is already implemented
+ # as INCRBY redis command.
+ return self.incr(name, amount)
+
def incrbyfloat(self, name, amount=1.0):
"""
Increments the value at key ``name`` by floating ``amount``.