Ñò
oàLc           @   sW   d  Z  d d k Z d „  Z e e d ƒ o e i Z n 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    	      o   sŽ   t  t |  ƒ | i d d ƒ } g  g } xC | D]; } g  } | D]! } | D] } | | | g qJ q@ ~ } q/ Wx | D] } t | ƒ Vqu Wd S(   sT   
    Taken from http://docs.python.org/library/itertools.html#itertools.product
    t   repeati   N(   t   mapt   tuplet   get(	   t   argst   kwdst   poolst   resultt   poolt   _[1]t   xt   yt   prod(    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/itercompat.pyt   product
   s    	 9 R   c         C   s-   y t  |  ƒ Wn t j
 o t SXt Sd S(   s:   A implementation independent way of checking for iterablesN(   t   itert	   TypeErrort   Falset   True(   R
   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/itercompat.pyt   is_iterable   s
    c         C   s!   x |  D] } | p t  Sq Wt S(   N(   R   R   (   t   iterablet   item(    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/itercompat.pyt   all#   s
     	c         C   s!   x |  D] } | o t  Sq Wt S(   N(   R   R   (   R   R   (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/itercompat.pyt   any)   s
     	(   t   __doc__t	   itertoolsR   t   hasattrR   R   R   (    (    (    sA   /usr/local/lib/python2.6/dist-packages/django/utils/itercompat.pyt   <module>   s   				