summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2018-11-15 01:49:29 -0800
committerAndy McCurdy <andy@andymccurdy.com>2018-11-15 01:49:29 -0800
commit1a1559b8caca0412b5621d2c8768577bbf0ccac3 (patch)
tree8d8ef4fd07e27750d2ea5f14c5af80d703d17d90
parent20639c334fa9180c046f1e8726057e9ee00e67de (diff)
downloadredis-py-1a1559b8caca0412b5621d2c8768577bbf0ccac3.tar.gz
fix rst format issues
-rw-r--r--README.rst8
-rw-r--r--redis/__init__.py11
2 files changed, 13 insertions, 6 deletions
diff --git a/README.rst b/README.rst
index 8327c19..0aa939c 100644
--- a/README.rst
+++ b/README.rst
@@ -103,10 +103,10 @@ MSET, MSETNX and ZADD
^^^^^^^^^^^^^^^^^^^^^
These commands all accept a mapping of key/value pairs. In redis-py 2.X
-this mapping could be specified as *args or as **kwargs. Both of these styles
-caused issues when Redis introduced optional flags to ZADD. Relying on *args
+this mapping could be specified as \*args or as \**kwargs. Both of these styles
+caused issues when Redis introduced optional flags to ZADD. Relying on \*args
caused issues with the optional argument order, especially in Python 2.7.
-Relying on **kwargs caused potential collision issues of user keys with the
+Relying on \**kwargs caused potential collision issues of user keys with the
argument names in the method signature.
To resolve this, redis-py 3.0 has changed these three commands to all accept
@@ -132,7 +132,7 @@ order of value and amount. ZINCRBY now looks like:
.. code-block:: pycon
- def zincrby(self, name, amount, value):
+ def zincrby(self, name, amount, value):
All 2.X users that rely on ZINCRBY must swap the order of amount and value
for the command to continue to work as intended.
diff --git a/redis/__init__.py b/redis/__init__.py
index e8bcb34..99b095a 100644
--- a/redis/__init__.py
+++ b/redis/__init__.py
@@ -22,8 +22,15 @@ from redis.exceptions import (
)
-__version__ = '3.0.0'
-VERSION = tuple(map(int, __version__.split('.')))
+def int_or_str(value):
+ try:
+ return int(value)
+ except ValueError:
+ return value
+
+
+__version__ = '3.0.0.post1'
+VERSION = tuple(map(int_or_str, __version__.split('.')))
__all__ = [
'Redis', 'StrictRedis', 'ConnectionPool', 'BlockingConnectionPool',