o
    B©ZhZ  ã                   @  s*   d dl mZ d dlmZmZ d
dd„Zd	S )é    )Úannotations)ÚAnyÚDictÚthisúDict[Any, Any]ÚthatÚreturnc                 C  s€   |   ¡ D ](\}}t|tƒr"||v r!t|| tƒr!t| | || ƒ q||v r,|| | |< q|  ¡ D ]\}}|| vr=|| |< q1| S )aò  Merge two nested dictionaries.

    Effectively a recursive ``dict.update``.

    Examples
    --------
    Merge two flat dictionaries:
    >>> nested_update(
    ...     {'a': 1, 'b': 2},
    ...     {'b': 3, 'c': 4}
    ... )
    {'a': 1, 'b': 3, 'c': 4}

    Merge two nested dictionaries:
    >>> nested_update(
    ...     {'x': {'a': 1, 'b': 2}, 'y': 5, 'z': 6},
    ...     {'x': {'b': 3, 'c': 4}, 'z': 7, '0': 8},
    ... )
    {'x': {'a': 1, 'b': 3, 'c': 4}, 'y': 5, 'z': 7, '0': 8}

    )ÚitemsÚ
isinstanceÚdictÚnested_update)r   r   ÚkeyÚvalue© r   úT/var/www/html/lang_env/lib/python3.10/site-packages/traitlets/utils/nested_update.pyr      s   
€€€r   N)r   r   r   r   r   r   )Ú
__future__r   Útypingr   r   r   r   r   r   r   Ú<module>   s   