Define incr/decr as aliases of incrby/decrby
@@ -1159,17 +1159,6 @@ class BasicKeyCommands:
params.append("REPLACE")
return self.execute_command("COPY", *params)
- def decr(self, name, amount=1):
- """
- Decrements the value of ``key`` by ``amount``. If no key exists,
- the value will be initialized as 0 - ``amount``
-
- For more information check https://redis.io/commands/decr
- """
- # An alias for ``decr()``, because it is already implemented
- # as DECRBY redis command.
- return self.decrby(name, amount)
-
def decrby(self, name, amount=1):
"""
Decrements the value of ``key`` by ``amount``. If no key exists,
@@ -1179,6 +1168,8 @@ class BasicKeyCommands:
"""
return self.execute_command("DECRBY", name, amount)
+ decr = decrby
+
def delete(self, *names):
"""
Delete one or more keys specified by ``names``
@@ -1350,15 +1341,6 @@ class BasicKeyCommands:
"""
return self.execute_command("GETSET", name, value)
- def incr(self, name, amount=1):
- """
- Increments the value of ``key`` by ``amount``. If no key exists,
- the value will be initialized as ``amount``
-
- For more information check https://redis.io/commands/incr
- """
- return self.incrby(name, amount)
-
def incrby(self, name, amount=1):
"""
Increments the value of ``key`` by ``amount``. If no key exists,
@@ -1366,10 +1348,10 @@ class BasicKeyCommands:
For more information check https://redis.io/commands/incrby
"""
- # An alias for ``incr()``, because it is already implemented
- # as INCRBY redis command.
return self.execute_command("INCRBY", name, amount)
+ incr = incrby
+
def incrbyfloat(self, name, amount=1.0):
"""
Increments the value at key ``name`` by floating ``amount``.
