Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify noreply + self.default_noreply behavior #255

Merged
merged 1 commit into from Sep 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions pymemcache/client/base.py
Expand Up @@ -372,9 +372,10 @@ def add(self, key, value, expire=0, noreply=None, flags=None):
flags

Returns:
If noreply is True, the return value is always True. Otherwise the
return value is True if the value was stored, and False if it was
not (because the key already existed).
If ``noreply`` is True (or if it is unset and ``self.default_noreply``
is True), the return value is always True. Otherwise the return value
is True if the value was stored, and False if it was not (because
the key already existed).
"""
if noreply is None:
noreply = self.default_noreply
Expand All @@ -396,7 +397,8 @@ def replace(self, key, value, expire=0, noreply=None, flags=None):
flags

Returns:
If noreply is True, always returns True. Otherwise returns True if
If ``noreply`` is True (or if it is unset and ``self.default_noreply``
is True), the return value is always True. Otherwise returns True if
the value was stored and False if it wasn't (because the key didn't
already exist).
"""
Expand Down Expand Up @@ -464,7 +466,8 @@ def cas(self, key, value, cas, expire=0, noreply=False, flags=None):
flags

Returns:
If noreply is True, always returns True. Otherwise returns None if
If ``noreply`` is True (or if it is unset and ``self.default_noreply``
is True), the return value is always True. Otherwise returns None if
the key didn't exist, False if it existed but had a different cas
value and True if it existed and was changed.
"""
Expand Down Expand Up @@ -546,7 +549,8 @@ def delete(self, key, noreply=None):
self.default_noreply).

Returns:
If noreply is True, always returns True. Otherwise returns True if
If ``noreply`` is True (or if it is unset and ``self.default_noreply``
is True), the return value is always True. Otherwise returns True if
the key was deleted, and False if it wasn't found.
"""
if noreply is None:
Expand Down