@@ -1159,17 +1159,6 @@ def copy(self, source, destination, destination_db=None, replace=False):
1159
1159
params .append ("REPLACE" )
1160
1160
return self .execute_command ("COPY" , * params )
1161
1161
1162
- def decr (self , name , amount = 1 ):
1163
- """
1164
- Decrements the value of ``key`` by ``amount``. If no key exists,
1165
- the value will be initialized as 0 - ``amount``
1166
-
1167
- For more information check https://redis.io/commands/decr
1168
- """
1169
- # An alias for ``decr()``, because it is already implemented
1170
- # as DECRBY redis command.
1171
- return self .decrby (name , amount )
1172
-
1173
1162
def decrby (self , name , amount = 1 ):
1174
1163
"""
1175
1164
Decrements the value of ``key`` by ``amount``. If no key exists,
@@ -1179,6 +1168,8 @@ def decrby(self, name, amount=1):
1179
1168
"""
1180
1169
return self .execute_command ("DECRBY" , name , amount )
1181
1170
1171
+ decr = decrby
1172
+
1182
1173
def delete (self , * names ):
1183
1174
"""
1184
1175
Delete one or more keys specified by ``names``
@@ -1350,26 +1341,17 @@ def getset(self, name, value):
1350
1341
"""
1351
1342
return self .execute_command ("GETSET" , name , value )
1352
1343
1353
- def incr (self , name , amount = 1 ):
1354
- """
1355
- Increments the value of ``key`` by ``amount``. If no key exists,
1356
- the value will be initialized as ``amount``
1357
-
1358
- For more information check https://redis.io/commands/incr
1359
- """
1360
- return self .incrby (name , amount )
1361
-
1362
1344
def incrby (self , name , amount = 1 ):
1363
1345
"""
1364
1346
Increments the value of ``key`` by ``amount``. If no key exists,
1365
1347
the value will be initialized as ``amount``
1366
1348
1367
1349
For more information check https://redis.io/commands/incrby
1368
1350
"""
1369
- # An alias for ``incr()``, because it is already implemented
1370
- # as INCRBY redis command.
1371
1351
return self .execute_command ("INCRBY" , name , amount )
1372
1352
1353
+ incr = incrby
1354
+
1373
1355
def incrbyfloat (self , name , amount = 1.0 ):
1374
1356
"""
1375
1357
Increments the value at key ``name`` by floating ``amount``.
0 commit comments