summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-07-13 13:29:11 -0400
committerTim Graham <timograham@gmail.com>2013-07-14 13:02:55 -0400
commit2456ffa42c33d63b54579eae0f5b9cf2a8cd3714 (patch)
tree06a8364994fcb6689f39cdf47b0f0372302ee2c5 /django/utils
parent0d81fd0e5f44432cbd1efb9b0e655116427dee6e (diff)
Fixed #20746 -- Removed Python 2.6 specific code/docs
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/functional.py5
-rw-r--r--django/utils/itercompat.py14
2 files changed, 2 insertions, 17 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 93befcf59e..d5d52205d7 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -398,9 +398,8 @@ def partition(predicate, values):
if sys.version_info >= (2, 7, 2):
from functools import total_ordering
else:
- # For Python < 2.7.2. Python 2.6 does not have total_ordering, and
- # total_ordering in 2.7 versions prior to 2.7.2 is buggy. See
- # http://bugs.python.org/issue10042 for details. For these versions use
+ # For Python < 2.7.2. total_ordering in versions prior to 2.7.2 is buggy.
+ # See http://bugs.python.org/issue10042 for details. For these versions use
# code borrowed from Python 2.7.3.
def total_ordering(cls):
"""Class decorator that fills in missing ordering methods"""
diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py
index 1df1e57cb2..096f808671 100644
--- a/django/utils/itercompat.py
+++ b/django/utils/itercompat.py
@@ -4,9 +4,6 @@ Where possible, we try to use the system-native version and only fall back to
these implementations if necessary.
"""
-import collections
-import sys
-
def is_iterable(x):
"A implementation independent way of checking for iterables"
@@ -16,14 +13,3 @@ def is_iterable(x):
return False
else:
return True
-
-def is_iterator(x):
- """An implementation independent way of checking for iterators
-
- Python 2.6 has a different implementation of collections.Iterator which
- accepts anything with a `next` method. 2.7+ requires and `__iter__` method
- as well.
- """
- if sys.version_info >= (2, 7):
- return isinstance(x, collections.Iterator)
- return isinstance(x, collections.Iterator) and hasattr(x, '__iter__')