redis-py : What's the difference between StrictRedis() and Redis()?

后端 未结 2 1557
小鲜肉
小鲜肉 2021-01-31 00:44

I want to use redis-py for caching some data, but I can\'t find a suitable explanation of the difference between redis.StrictRedis() and redis.Redis(

2条回答
  •  一个人的身影
    2021-01-31 01:29

    It's an old question but for anyone who reaches this question after google search:

    from redis-py readme (link):

    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.

    Here is the line from redis-py code which defines StrictRedis (link):

    StrictRedis = Redis
    

提交回复
热议问题