redis-py exposes two client classes that implement these commands
The StrictRedis class attempts to adhere to the official command syntax.
以及
In addition to the changes above, the Redis class, a subclass of StrictRedis,
overrides several other commands to provide backwards compatibility with older
versions of redis-py
你需要向后兼容吗?使用Redis。不在乎?使用StrictRedis。
2017年3月31日
以下是从github.com链接引用的向后兼容性的详细信息:
In addition to the changes above, the Redis class, a subclass of StrictRedis, overrides several other commands to provide backwards compatibility with older versions of redis-py:
LREM: Order of 'num' and 'value' arguments reversed such that 'num' can provide a default value of zero.
ZADD: Redis specifies the 'score' argument before 'value'. These were swapped accidentally when being implemented and not discovered until after people were already using it. The Redis class expects *args in the form of: name1, score1, name2, score2, ...
SETEX: Order of 'time' and 'value' arguments reversed.
redis-py 3.0 drops support for the legacy "Redis" client class.
"StrictRedis" has been renamed to "Redis" and an alias named
"StrictRedis" is provided so that users previously using "StrictRedis"
can continue to run unchanged.
This seems pretty clear:
以及
你需要向后兼容吗?使用
Redis
。不在乎?使用StrictRedis
。2017年3月31日
以下是从github.com链接引用的向后兼容性的详细信息:
这是一个古老的问题,但是对于在谷歌搜索之后找到这个问题的人来说:
来自redis py自述文件(link):
这是redis py代码中定义
StrictRedis
(link)的一行:相关问题 更多 >
编程相关推荐