Merge branch 'oremj-fix_delete_defaults'

This commit is contained in:
Sean Reifschneider 2016-05-27 13:25:44 -06:00
commit d8cfb1693a
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,7 @@
* delete() and delete_multi() now default the "time" argument to None,
since the protocol doesn't allow a time in some implementations.
Patch by oremj #27
Fri, 31 Jul 2015 11:38:25 -0600 Sean Reifschneider <jafo@tummy.com>
* 1.57 release.

View File

@ -456,7 +456,7 @@ class Client(threading.local):
for s in self.servers:
s.close_socket()
def delete_multi(self, keys, time=0, key_prefix='', noreply=False):
def delete_multi(self, keys, time=None, key_prefix='', noreply=False):
"""Delete multiple keys in the memcache doing just one query.
>>> notset_keys = mc.set_multi({'a1' : 'val1', 'a2' : 'val2'})
@ -530,7 +530,7 @@ class Client(threading.local):
rc = 0
return rc
def delete(self, key, time=0, noreply=False):
def delete(self, key, time=None, noreply=False):
'''Deletes a key from the memcache.
@return: Nonzero on success.
@ -868,7 +868,7 @@ class Client(threading.local):
sending to memcache. Allows you to efficiently stuff these
keys into a pseudo-namespace in memcache:
>>> notset_keys = mc.set_multi(
>> notset_keys = mc.set_multi(
... {'key1' : 'val1', 'key2' : 'val2'},
... key_prefix='subspace_')
>>> len(notset_keys) == 0