搭建代理池的时候遇到的坑。
import redis
db = redis.StrictRedis(host=host, port=port, password=password, decode_responses=True)
redis-py 3.0之前写法:
db.zadd(key, score, proxy)
db.zincrby(key, proxy, -1)
redis-py 3.0之后写法:
db.zadd(key, {proxy: score})
db.zincrby(key, -1, proxy)