o
    B©Zh  ã                   @  s0   d Z ddlmZ ddlmZ G dd„ deƒZdS )zJYet another implementation of bunch

attribute-access of items on a dict.
é    )Úannotations)ÚAnyc                   @  s.   e Zd ZdZddd„Zdd
d„Zddd„ZdS )ÚBunchzA dict with attribute-accessÚkeyÚstrÚreturnr   c              
   C  s0   z|   |¡W S  ty } zt|ƒ|‚d }~ww ©N)Ú__getitem__ÚKeyErrorÚAttributeError)Úselfr   Úe© r   úL/var/www/html/lang_env/lib/python3.10/site-packages/traitlets/utils/bunch.pyÚ__getattr__   s   
€ÿzBunch.__getattr__ÚvalueÚNonec                 C  s   |   ||¡ d S r   )Ú__setitem__)r   r   r   r   r   r   Ú__setattr__   s   zBunch.__setattr__ú	list[str]c                 C  s   t i ƒ}| |  ¡ ¡ |S r   )ÚdirÚextendÚkeys)r   Únamesr   r   r   Ú__dir__   s   zBunch.__dir__N)r   r   r   r   )r   r   r   r   r   r   )r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s
    

r   N)r   Ú
__future__r   Útypingr   Údictr   r   r   r   r   Ú<module>   s    