ó
ëƒ\c           @` sƒ   d  d l  m Z m Z m Z y d  d l m Z m Z Wn' e k
 r_ d  d l m Z m Z n Xd e f d „  ƒ  YZ	 d „  Z
 d S(   i    (   t   absolute_importt   divisiont   print_function(   t   Mappingt   MutableMappingt   ZictBasec           B` s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s'   
    Base class for zict mappings.
    c          O` sÒ   |  s t  d ƒ ‚ n  |  d } |  d }  t |  ƒ d k rT t  d t |  ƒ ƒ ‚ n  g  } |  r¨ |  d } t | t ƒ sˆ t | d ƒ r› | | j ƒ  7} q¨ | | 7} n  | rÁ | | j ƒ  7} n  | j | ƒ d  S(   Ns>   descriptor 'update' of MutableMapping object needs an argumenti    i   s+   update expected at most 1 arguments, got %dt   items(   t	   TypeErrort   lent
   isinstanceR   t   hasattrR   t
   _do_update(   t   argst   kwdst   selfR   t   other(    (    s*   lib/python2.7/site-packages/zict/common.pyt   update   s     


c         C` s%   x | D] \ } } | |  | <q Wd  S(   N(    (   R   R   t   kt   v(    (    s*   lib/python2.7/site-packages/zict/common.pyR   $   s    c         C` s   d S(   sC   
        Release any system resources held by this object.
        N(    (   R   (    (    s*   lib/python2.7/site-packages/zict/common.pyt   close)   t    c         C` s   |  S(   N(    (   R   (    (    s*   lib/python2.7/site-packages/zict/common.pyt	   __enter__.   s    c         G` s   |  j  ƒ  d  S(   N(   R   (   R   R   (    (    s*   lib/python2.7/site-packages/zict/common.pyt   __exit__1   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   R   (    (    (    s*   lib/python2.7/site-packages/zict/common.pyR   	   s   				c         C` s    t  |  d ƒ r |  j ƒ  n  d S(   s    
    Close *z* if possible.
    R   N(   R
   R   (   t   z(    (    s*   lib/python2.7/site-packages/zict/common.pyR   5   s    N(   t
   __future__R    R   R   t   collections.abcR   R   t   ImportErrort   collectionsR   R   (    (    (    s*   lib/python2.7/site-packages/zict/common.pyt   <module>   s   ,