�
��gq � �, � d Z dgZ G d� de� � ZdS )zMisc dict tools.�hashdictc �T � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zd� Z
d� Zd
S )r a<
hashable dict implementation, suitable for use as a key into
other dicts.
>>> h1 = hashdict({"apples": 1, "bananas":2})
>>> h2 = hashdict({"bananas": 3, "mangoes": 5})
>>> h1+h2
hashdict(apples=1, bananas=3, mangoes=5)
>>> d1 = {}
>>> d1[h1] = "salad"
>>> d1[h1]
'salad'
>>> d1[h2]
Traceback (most recent call last):
...
KeyError: hashdict(bananas=3, mangoes=5)
based on answers from
http://stackoverflow.com/questions/1151658/python-hashable-dicts
c �^ � t t | � � � � � � � S �N)�tuple�sorted�items��selfs �h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fontTools/misc/dictTools.py�__keyzhashdict.__key s � ��V�D�J�J�L�L�)�)�*�*�*� c � � d� | j j d� d� | � � � D � � � � � � S )Nz{0}({1})z, c 3 � K � | ]@}d � t |d � � t |d � � � � V � �AdS )z{0}={1}� � N)�format�str�repr)�.0�is r � <genexpr>z$hashdict.__repr__.<locals>.<genexpr>$ sF � � � �T�T�!�i�&�&�s�1�Q�4�y�y�$�q��t�*�*�=�=�T�T�T�T�T�Tr
)r � __class__�__name__�join�_hashdict__keyr s r �__repr__zhashdict.__repr__! sH � �� � ��N�#��I�I�T�T�t�z�z�|�|�T�T�T�T�T�
�
�
r
c �D � t | � � � � � S r )�hashr r s r �__hash__zhashdict.__hash__'