
    Eqg                     z    d dl Zd dlmZmZ d dlmZ e G d dej        j                              Z	dedefdZ
dS )	    N)AnyCallable)	immutablec            	       d    e Zd Zdefdededeg ej        j	        f         fdZ
d Zd Zd Zd	 Zd
S )DictF
dictionaryno_copymap_factoryc                     |r't          |t          j        j                  r|| _        n) |            | _        | j                            |           d| _        dS )a  Make an immutable dictionary from the specified dictionary.

        If *no_copy* is `True`, then *dictionary* will be wrapped instead
        of copied.  Only set this if you are sure there will be no external
        references to the dictionary.
        N)
isinstancecollectionsabcMutableMapping_odictupdate_hash)selfr   r	   r
   s       ?/var/www/html/env/lib/python3.11/site-packages/dns/immutable.py__init__zDict.__init__   sY      	+z*ko.LMM 	+$DKK%+--DKKz***


    c                 6    | j                             |          S N)r   __getitem__)r   keys     r   r   zDict.__getitem__   s    {&&s+++r   c                     | j         Yd}t          | j                                                  D ]}|t	          |          z  }t
                              | d|           | j         S )Nr   r   )r   sortedr   keyshashobject__setattr__)r   hr   s      r   __hash__zDict.__hash__!   se    :Adk..0011  T#YYtWa000zr   c                 *    t          | j                  S r   )lenr   r   s    r   __len__zDict.__len__*   s    4;r   c                 *    t          | j                  S r   )iterr   r%   s    r   __iter__zDict.__iter__-   s    DK   r   N)__name__
__module____qualname__dictr   boolr   r   r   r   r   r   r"   r&   r)    r   r   r   r   	   s        
 DH	   b+/"@@A	   &, , ,       ! ! ! ! !r   r   oreturnc                    t          | t                    rt          |           S t          | t                    r;	 t	          |            | S # t
          $ r t          d | D                       cY S w xY wt          | t                    rt          d | D                       S t          | t                    rJt                      }|                                 D ]\  }}t          |          ||<   t          |d          S | S )z3
    Convert mutable types to immutable types.
    c              3   4   K   | ]}t          |          V  d S r   constify.0elts     r   	<genexpr>zconstify.<locals>.<genexpr><   s(      443#444444r   c              3   4   K   | ]}t          |          V  d S r   r4   r6   s     r   r9   zconstify.<locals>.<genexpr>>   s(      00sXc]]000000r   T)r   	bytearraybytestupler   	Exceptionlistr-   itemsr5   r   )r0   cdictkvs       r   r5   r5   1   s    !Y Qxx!U 5	5GGGH 	5 	5 	544!44444444	5!T 100a000000!T !GGII 	# 	#DAq{{E!HHE4   Hs   A #A21A2)collections.abcr   typingr   r   dns._immutable_ctxr   r   Mappingr   r5   r/   r   r   <module>rH      s                        ( ( ( ( ( ( $! $! $! $! $!;?" $! $! $!N       r   