ó
ů˘TQc           @   sg   d  Z  d d l Z d d l Z d d l Z d d l Z d   Z d   Z d   Z d   Z d   Z	 d S(   sÂ   
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.
i˙˙˙˙Nc         C   s+   y t  |   Wn t k
 r" t SXt Sd S(   s:   A implementation independent way of checking for iterablesN(   t   itert	   TypeErrort   Falset   True(   t   x(    (    s0   ../Django//lib/python/django/utils/itercompat.pyt   is_iterable   s
    c         C   s>   t  j d k r t |  t j  St |  t j  o= t |  d  S(   sé   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.
    i   i   t   __iter__(   i   i   (   t   syst   version_infot
   isinstancet   collectionst   Iteratort   hasattr(   R   (    (    s0   ../Django//lib/python/django/utils/itercompat.pyt   is_iterator   s    c          O   s    t  j d t  t j |  |   S(   NsM   django.utils.itercompat.product is deprecated; use the native version instead(   t   warningst   warnt   PendingDeprecationWarningt	   itertoolst   product(   t   argst   kwds(    (    s0   ../Django//lib/python/django/utils/itercompat.pyR   !   s    	c         C   s   t  j d t  t j |   S(   NsI   django.utils.itercompat.all is deprecated; use the native version instead(   R   R   t   DeprecationWarningt   builtinst   all(   t   iterable(    (    s0   ../Django//lib/python/django/utils/itercompat.pyR   &   s    	c         C   s   t  j d t  t j |   S(   NsI   django.utils.itercompat.any is deprecated; use the native version instead(   R   R   R   R   t   any(   R   (    (    s0   ../Django//lib/python/django/utils/itercompat.pyR   +   s    	(
   t   __doc__R
   R   R   R   R   R   R   R   R   (    (    (    s0   ../Django//lib/python/django/utils/itercompat.pyt   <module>   s   					