diff options
author | Krzysztof Dorosz <cypreess@gmail.com> | 2013-04-28 11:24:00 +0200 |
---|---|---|
committer | Krzysztof Dorosz <cypreess@gmail.com> | 2013-04-28 11:24:00 +0200 |
commit | d082f0fe3985a36d6a5705d6fd3365a7d573d1f8 (patch) | |
tree | 1b730e3b4e4539443fddb0314a83ec01284d1b2d | |
parent | 07990bccb5969154cb1fc01fedf7265bb950e2d7 (diff) | |
download | redis-py-d082f0fe3985a36d6a5705d6fd3365a7d573d1f8.tar.gz |
Adding incrby alias
-rw-r--r-- | redis/client.py | 10 |
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``. |