ó
O'—^c           @@  s­   d  d l  m Z d  d l Z d  d l m Z m Z d  d l m Z d d d d g Z d e	 f d	 „  ƒ  YZ
 d
 „  Z e e f e f d „ Z e e f d „ Z e
 Z e Z d S(   i    (   t   absolute_importN(   t   Iterablet   Mapping(   t   string_tt   lazyt   maybe_evaluatet   is_listt
   maybe_listc           B@  s~   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z e j d
 d k  r| d „  Z n  RS(   s  Holds lazy evaluation.

    Evaluated when called or if the :meth:`evaluate` method is called.
    The function is re-evaluated on every call.

    Overloaded operations that will evaluate the promise:
        :meth:`__str__`, :meth:`__repr__`, :meth:`__cmp__`.

    c         O@  s   | |  _  | |  _ | |  _ d  S(   N(   t   _funt   _argst   _kwargs(   t   selft   funt   argst   kwargs(    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __init__   s    		c         C@  s
   |  j  ƒ  S(   N(   t   evaluate(   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __call__   s    c         C@  s   |  j  |  j |  j Ž  S(   N(   R   R	   R
   (   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyR      s    c         C@  s   t  |  ƒ  ƒ S(   N(   t   str(   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __str__"   s    c         C@  s   t  |  ƒ  ƒ S(   N(   t   repr(   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __repr__%   s    c         C@  s   |  ƒ  | k S(   N(    (   R   t   rhs(    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __eq__(   s    c         C@  s   |  ƒ  | k S(   N(    (   R   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __ne__+   s    c         C@  s   |  | t  |  ƒ <|  S(   N(   t   id(   R   t   memo(    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __deepcopy__.   s    c         C@  s*   |  j  |  j f i |  j d 6|  j d 6f S(   NR	   R
   (   t	   __class__R   R	   R
   (   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt
   __reduce__2   s    i    i   c         C@  s3   t  | |  j ƒ r# t | |  ƒ  ƒ St |  ƒ  | ƒ S(   N(   t
   isinstanceR   t   cmp(   R   R   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   __cmp__8   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   R   R   R   t   syst   version_infoR    (    (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyR      s   										c         C@  s   t  |  t ƒ r |  j ƒ  S|  S(   s3   Evaluates if the value is a :class:`lazy` instance.(   R   R   R   (   t   value(    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyR   >   s    
c         C@  s#   t  |  | ƒ o" t  |  | p d ƒ S(   sU   Return true if the object is iterable (but not
    if object is a mapping or string).(    (   R   (   t   lt   scalarst   iters(    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyR   E   s    c         C@  s&   |  d k s t |  | ƒ r |  S|  g S(   s0   Return list of one element if ``l`` is a scalar.N(   t   NoneR   (   R'   R(   (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyR   K   s    (   t
   __future__R    R$   t   collectionsR   R   t
   kombu.fiveR   t   __all__t   objectR   R   R   R   t   promiset   maybe_promise(    (    (    s8   /tmp/pip-unpacked-wheel-UAnTfW/kombu/utils/functional.pyt   <module>   s   2	