这似乎很清楚:
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 olderversions of redis-py
您需要向后兼容吗?使用
Redis。不在乎吗 使用
StrictRedis。
2017-03-31
以下是从github.com链接引用的向后兼容性的详细信息:
除了上述更改之外,Redis类是StrictRedis的子类,它重写了其他几个命令以提供与较早版本的redis-py的向后兼容性:
LREM:“ num”和“ value”自变量的顺序相反,因此“ num”可以提供默认值零。
ZADD:Redis在’value’之前指定’score’参数。这些在实施时被意外交换,直到人们使用后才被发现。Redis类期望*
args的形式为:name1,score1,name2,score2,…SETEX:“时间”和“值”参数的顺序颠倒了。



