
    ,h                         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
y)	    N)AnyCallable)	immutablec            	       p    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y
)DictF
dictionaryno_copymap_factoryc                     |r3t        |t        j                  j                        r|| _        d| _        y |       | _        | j                  j                  |       d| _        y)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       O/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/dns/immutable.py__init__zDict.__init__   sN     z*koo.L.LM$DK 
 &-DKKKz*
    c                 8    | j                   j                  |      S N)r   __getitem__)r   keys     r   r   zDict.__getitem__   s    {{&&s++r   c                     | j                   Od}t        | j                  j                               D ]  }|t	        |      z  } t
        j                  | d|       | j                   S )Nr   r   )r   sortedr   keyshashobject__setattr__)r   hr   s      r   __hash__zDict.__hash__!   s[    ::Adkk..01 T#YtWa0zz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    DKK  r   N)__name__
__module____qualname__dictr   boolr   r   r   r   r   r   r"   r&   r)    r   r   r   r   	   sS    
 DH	  b+//"@"@@A	&, !r   r   oreturnc                    t        | t              rt        |       S t        | t              r	 t	        |        | S t        | t              rt        d | D              S t        | t              r<t               }| j                         D ]  \  }}t        |      ||<    t        |d      S | S # t
        $ r t        d | D              cY S w xY w)z3
    Convert mutable types to immutable types.
    c              3   2   K   | ]  }t        |        y wr   constify.0elts     r   	<genexpr>zconstify.<locals>.<genexpr><   s     43#4   c              3   2   K   | ]  }t        |        y wr   r4   r6   s     r   r9   zconstify.<locals>.<genexpr>>   s     0sXc]0r:   T)r   	bytearraybytestupler   	Exceptionlistr-   itemsr5   r   )r0   cdictkvs       r   r5   r5   1   s     !YQx!U	5GH !T0a000!TGGI 	#DAq{E!H	#E4  H  	54!444	5s   B* *CC)collections.abcr   typingr   r   dns._immutable_ctxr   r   Mappingr   r5   r/   r   r   <module>rI      sI       ( $!;??"" $! $!N  r   