From 23de82967c7424a5923c45170785216cea29feea Mon Sep 17 00:00:00 2001 From: nsantiago2719 Date: Mon, 31 Jul 2017 09:13:04 +0800 Subject: add note on readme file --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 29f9b5d..c05a2da 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ Getting Started .. code-block:: pycon >>> import redis - >>> r = redis.StrictRedis(host='localhost', port=6379, db=0) + >>> r = redis.StrictRedis(host='localhost', port=6379, db=0) #Add `decode_responses=True` if you are using Python 3 >>> r.set('foo', 'bar') True >>> r.get('foo') -- cgit v1.2.1 From c8e61b3efdf0f9400fa27803e36094e24a99fc43 Mon Sep 17 00:00:00 2001 From: nsantiago2719 Date: Fri, 25 Aug 2017 15:28:21 +0800 Subject: clarified the documentation --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c05a2da..f77c040 100644 --- a/README.rst +++ b/README.rst @@ -37,12 +37,15 @@ Getting Started .. code-block:: pycon >>> import redis - >>> r = redis.StrictRedis(host='localhost', port=6379, db=0) #Add `decode_responses=True` if you are using Python 3 + >>> r = redis.StrictRedis(host='localhost', port=6379, db=0) >>> r.set('foo', 'bar') True >>> r.get('foo') 'bar' +By default, the value returned if you are using Python3 are in raw byte strings. +If you want a decoded response you can add `decode_response=True` in `redis.StrictRedis()`. + API Reference ------------- -- cgit v1.2.1 From e5e08d52a8f36033ced0d74c38b14ad559e811ac Mon Sep 17 00:00:00 2001 From: norman Date: Mon, 9 Oct 2017 20:10:42 +0800 Subject: update grammar --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f77c040..90effc4 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ Getting Started >>> r.get('foo') 'bar' -By default, the value returned if you are using Python3 are in raw byte strings. +By default, the value returned are bytes in python3. If you want a decoded response you can add `decode_response=True` in `redis.StrictRedis()`. API Reference -- cgit v1.2.1 From 024ea5221c4c8237cb36a82ef1675886963b3d5e Mon Sep 17 00:00:00 2001 From: Andy McCurdy Date: Mon, 9 Oct 2017 15:22:02 -0700 Subject: additional info regarding decode_responses=True --- README.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 90effc4..307224a 100644 --- a/README.rst +++ b/README.rst @@ -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 ------------- -- cgit v1.2.1