B
    P•\  ã               @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é    )Úabsolute_import)Údefaultdictc                   s.   e Zd ZdZd‡ fdd„	Z‡ fdd„Z‡  ZS )ÚBoundDictionarya  
    A default dictionary where elements are tightly coupled.

    The factory method is responsible for binding the parent object to the child.

    If a reference attribute is assigned then child objects will have the key assigned to this.

    Otherwise it's just a defaultdict.
    Nc                s   || _ tt| ƒj||Ž d S )N)Ú	referenceÚsuperr   Ú__init__)Úselfr   ÚargsÚkw)Ú	__class__© ú>lib/python3.7/site-packages/openpyxl/utils/bound_dictionary.pyr      s    zBoundDictionary.__init__c                s,   t t| ƒ |¡}| jd k	r(t|| j|ƒ |S )N)r   r   Ú__getitem__r   Úsetattr)r   ÚkeyÚvalue)r   r   r   r      s    
zBoundDictionary.__getitem__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__r   r   )r   r   r      s   	r   N)Z
__future__r   Úcollectionsr   r   r   r   r   r   Ú<module>   s   