python3-memcached icon indicating copy to clipboard operation
python3-memcached copied to clipboard

Return value of delete() is wrong

Open j-schulz opened this issue 4 years ago • 0 comments

Example:

import memcache m = memcache.Client(["127.0.0.1:11211"]) m.set("foo", "bar") print(m.delete("foo")) print(m.delete("foo"))

Output: 1 1

telnet localhost 11211 set foo 0 0 3 data bar STORED delete foo DELETED delete foo NOT_FOUND

So returning 1 if the key does not exist is wrong. I expect 0 or False or None, but not 1.

j-schulz avatar Oct 27 '21 01:10 j-schulz