summaryrefslogtreecommitdiff
path: root/lib/python2.7/site-packages/django/utils/itercompat.py
diff options
context:
space:
mode:
authorcoderick142017-05-17 15:40:18 +0530
committercoderick142017-05-17 15:41:00 +0530
commita1e0a5502f04da68b6a9ca8508dda3f9d7e1d055 (patch)
tree20181e6b1936f50ad48d8e35720d64a37566f558 /lib/python2.7/site-packages/django/utils/itercompat.py
parent6f4a84c1e58ff4d54aab94cbee26e995328b05b8 (diff)
downloadSBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.tar.gz
SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.tar.bz2
SBHS-2018-Rpi-a1e0a5502f04da68b6a9ca8508dda3f9d7e1d055.zip
Upgrade to Django 1.11
- Database integration yet to be tested
Diffstat (limited to 'lib/python2.7/site-packages/django/utils/itercompat.py')
-rw-r--r--lib/python2.7/site-packages/django/utils/itercompat.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/python2.7/site-packages/django/utils/itercompat.py b/lib/python2.7/site-packages/django/utils/itercompat.py
deleted file mode 100644
index c50dcfb..0000000
--- a/lib/python2.7/site-packages/django/utils/itercompat.py
+++ /dev/null
@@ -1,36 +0,0 @@
-"""
-Providing iterator functions that are not in all version of Python we support.
-Where possible, we try to use the system-native version and only fall back to
-these implementations if necessary.
-"""
-
-import collections
-import itertools
-import sys
-import warnings
-
-
-def is_iterable(x):
- "A implementation independent way of checking for iterables"
- try:
- iter(x)
- except TypeError:
- 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__')
-
-def product(*args, **kwds):
- warnings.warn("django.utils.itercompat.product is deprecated; use the native version instead",
- DeprecationWarning, stacklevel=2)
- return itertools.product(*args, **kwds)