U
    fª/eù  ã                   @   sD   d dl mZmZmZmZ edƒZedƒZG dd„ deeef ƒZdS )é    )ÚChainMapÚMutableMappingÚTypeVarÚcastÚ_KTÚ_VTc                   @   s2   e Zd ZdZeeddœdd„Zeddœdd„ZdS )	ÚDeepChainMapz~
    Variant of ChainMap that allows direct updates to inner scopes.

    Only works when all passed mapping are mutable.
    N)ÚkeyÚvalueÚreturnc                 C   sT   | j D ],}ttttf |ƒ}||kr|||<  d S q|ttttf | j d ƒ|< d S )Nr   )Úmapsr   r   r   r   )Úselfr	   r
   ÚmappingÚmutable_mapping© r   ú:/tmp/pip-unpacked-wheel-tiezk1ph/pandas/compat/chainmap.pyÚ__setitem__   s    
zDeepChainMap.__setitem__)r	   r   c                 C   s>   | j D ]*}ttttf |ƒ}||kr||=  dS qt|ƒ‚dS )z\
        Raises
        ------
        KeyError
            If `key` doesn't exist.
        N)r   r   r   r   r   ÚKeyError)r   r	   r   r   r   r   r   Ú__delitem__   s    
zDeepChainMap.__delitem__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s   r   N)Útypingr   r   r   r   r   r   r   r   r   r   r   Ú<module>   s   