Define incr/decr as aliases of incrby/decrby #1874
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request check-list
Please make sure to review and check all of these items:
$ tox
pass with this change (including linting)?(I would welcome some help on how to set up the CI tests on my forked repo, if this is necessary (it's already running in this PR). I couldn't figure it out, and the Contributing guide wasn't helpful)
Description of change
Currently,
incr
anddecr
are implemented as identical wrappers of the functionsincrby
anddecrby
.Their documentation is also identical to the other functions, with the difference of linking to the original command's Redis reference.
repr
is documented as:This is incorrect and misleading, since Redis's documentation of
incr
contains no mention ofamount
.This change sets up
incr
anddecr
as direct aliases ofincrby
anddecrby
by assignment. This also means they share docstrings, so that both will lead toincrby
anddecrby
's original references. I think this makes more sense given the function signatures. (I checked the generated Sphinx documentation and it is identical, other than the Redis URLs).I also removed the comment in
incrby
that claims it is an alias ofincr
. I think it's the other way around, and I don't think the comment is adding much. Perhaps it's more useful to document the fact thatincr
is an alias ofincrby
for backwards compatibility...?