Skip to content

Commit

Permalink
Remove some Python 2 references
Browse files Browse the repository at this point in the history
  • Loading branch information
bbayles committed Feb 5, 2019
1 parent f74560c commit 10bab0e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
4 changes: 0 additions & 4 deletions docs/usage-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ This behavior applies to ``complex``, ``float``, ``Decimal``, and ``Fraction``
values that have an integer equivalent. It doesn't apply to values that don't
have an integer equivalent (such as ``1.1`` or ``complex(1, 1)``).

On Python 2 only, ``unicode`` types are converted to ``str`` types
(with UTF-8 encoding) before being sent to Redis. ``str`` types are decoded to
``unicode`` types after being retrieved from Redis (if possible).

Security considerations
-----------------------

Expand Down
5 changes: 1 addition & 4 deletions redis_collections/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
import abc
from decimal import Decimal
from fractions import Fraction
import uuid

# We use pickle instead of cPickle on Python 2 intentionally, see
# http://bugs.python.org/issue5518
import pickle
import uuid

import redis

Expand Down
6 changes: 0 additions & 6 deletions redis_collections/dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class Dict(RedisCollection, collections_abc.MutableMapping):
<https://docs.python.org/3/library/stdtypes.html#mapping-types-dict>`_ for
usage notes.
The :func:`viewitems`, :func:`viewkeys`, and :func:`viewvalues` methods
from Python 2.7's dictionary type are not implemented.
"""

_pickle_key = RedisCollection._pickle_3
Expand Down Expand Up @@ -430,8 +428,6 @@ class Counter(Dict):
Counter inherits from Dict, so see its API documentation for information
on other methods.
The :func:`viewitems`, :func:`viewkeys`, and :func:`viewvalues` methods
from Python 2.7's Counter type are not implemented.
"""

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -670,8 +666,6 @@ class DefaultDict(Dict):
DefaultDict inherits from Dict, so see its API documentation for
information on other methods.
The :func:`viewitems`, :func:`viewkeys`, and :func:`viewvalues` methods
from Python 2.7's Counter type are not implemented.
"""

def __init__(self, *args, **kwargs):
Expand Down
1 change: 0 additions & 1 deletion tests/test_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def test_clear(self):
redis_list = self.create_list(data)
redis_cached = self.create_list(data, writeback=True)

# Python 2.x lists don't have a clear method
for L in (redis_list, redis_cached):
L[0] = 'Zero'
L.clear()
Expand Down

0 comments on commit 10bab0e

Please sign in to comment.