Skip to content

Return value of delete() is wrong #21

@j-schulz

Description

@j-schulz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions