mirror of
https://github.com/django/django.git
synced 2024-11-18 23:44:22 +00:00
16 lines
386 B
Python
16 lines
386 B
Python
"""
|
|
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.
|
|
"""
|
|
|
|
|
|
def is_iterable(x):
|
|
"A implementation independent way of checking for iterables"
|
|
try:
|
|
iter(x)
|
|
except TypeError:
|
|
return False
|
|
else:
|
|
return True
|