B
    ëƒ\ç  ã               @   sj   d dl mZmZmZ yd dlmZmZ W n$ ek
rL   d dlmZmZ Y nX G dd„ deƒZ	dd„ Z
dS )é    )Úabsolute_importÚdivisionÚprint_function)ÚMappingÚMutableMappingc               @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚZictBasez'
    Base class for zict mappings.
    c              O   s”   | st dƒ‚| d }| dd … } t| ƒdkr<t dt| ƒ ƒ‚g }| rv| d }t|tƒs`t|dƒrn|| ¡ 7 }n||7 }|r†|| ¡ 7 }| |¡ d S )Nz>descriptor 'update' of MutableMapping object needs an argumentr   é   z+update expected at most 1 arguments, got %dÚitems)Ú	TypeErrorÚlenÚ
isinstancer   Úhasattrr	   Ú
_do_update)ÚargsÚkwdsÚselfr	   Úother© r   ú*lib/python3.7/site-packages/zict/common.pyÚupdate   s     zZictBase.updatec             C   s   x|D ]\}}|| |< qW d S )Nr   )r   r	   ÚkÚvr   r   r   r   $   s    zZictBase._do_updatec             C   s   dS )zC
        Release any system resources held by this object.
        Nr   )r   r   r   r   Úclose)   s    zZictBase.closec             C   s   | S )Nr   )r   r   r   r   Ú	__enter__.   s    zZictBase.__enter__c             G   s   |   ¡  d S )N)r   )r   r   r   r   r   Ú__exit__1   s    zZictBase.__exit__N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r   	   s   r   c             C   s   t | dƒr|  ¡  dS )z 
    Close *z* if possible.
    r   N)r   r   )Úzr   r   r   r   5   s    
r   N)Z
__future__r   r   r   Zcollections.abcr   r   ÚImportErrorÚcollectionsr   r   r   r   r   r   Ú<module>   s   ,