diff options
| author | Tim Graham <timograham@gmail.com> | 2013-07-13 13:29:11 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-14 13:02:55 -0400 |
| commit | 2456ffa42c33d63b54579eae0f5b9cf2a8cd3714 (patch) | |
| tree | 06a8364994fcb6689f39cdf47b0f0372302ee2c5 /django/utils/itercompat.py | |
| parent | 0d81fd0e5f44432cbd1efb9b0e655116427dee6e (diff) | |
Fixed #20746 -- Removed Python 2.6 specific code/docs
Diffstat (limited to 'django/utils/itercompat.py')
| -rw-r--r-- | django/utils/itercompat.py | 14 |
1 files changed, 0 insertions, 14 deletions
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__') |
