diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2017-10-09 15:22:02 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2017-10-09 15:22:02 -0700 |
commit | 024ea5221c4c8237cb36a82ef1675886963b3d5e (patch) | |
tree | 155ee261c2975dce2239fa037015d8b32ed4e42a | |
parent | e5e08d52a8f36033ced0d74c38b14ad559e811ac (diff) | |
download | redis-py-024ea5221c4c8237cb36a82ef1675886963b3d5e.tar.gz |
additional info regarding decode_responses=True
-rw-r--r-- | README.rst | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -43,8 +43,14 @@ Getting Started >>> r.get('foo') 'bar' -By default, the value returned are bytes in python3. -If you want a decoded response you can add `decode_response=True` in `redis.StrictRedis()`. +By default, all responses are returned as `bytes` in Python 3 and `str` in +Python 2. The user is responsible for decoding to Python 3 strings or Python 2 +unicode objects. + +If **all** string responses from a client should be decoded, the user can +specify `decode_responses=True` to `StrictRedis.__init__`. In this case, any +Redis command that returns a string type will be decoded with the `encoding` +specified. API Reference ------------- |