
    g                         S SK rS SKJrJr  S SKJr  \ " S S\R                  R                  5      5       r	S\S\4S jr
g)	    N)AnyCallable)	immutablec            	       |    \ rS rSrS\4S\S\S\/ \R                  R                  4   4S jjrS rS rS	 rS
 rSrg)Dict	   F
dictionaryno_copymap_factoryc                     U(       a0  [        U[        R                  R                  5      (       a  Xl        O'U" 5       U l        U R                  R                  U5        SU l        g)zMake 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       F/home/matz/Project1/venv/lib/python3.13/site-packages/dns/immutable.py__init__Dict.__init__   sD     z*koo.L.LMM$K%-DKKKz*
    c                 8    U R                   R                  U5      $ N)r   __getitem__)r   keys     r   r   Dict.__getitem__   s    {{&&s++r   c                     U R                   cQ  Sn[        U R                  R                  5       5       H  nU[	        U5      -  nM     [
        R                  U SU5        U R                   $ )Nr   r   )r   sortedr   keyshashobject__setattr__)r   hr   s      r   __hash__Dict.__hash__!   sV    ::Adkk..01T#Y 2tWa0zzr   c                 ,    [        U R                  5      $ r   )lenr   r   s    r   __len__Dict.__len__*   s    4;;r   c                 ,    [        U R                  5      $ r   )iterr   r)   s    r   __iter__Dict.__iter__-   s    DKK  r   )r   r   N)__name__
__module____qualname____firstlineno__dictr   boolr   r   r   r   r   r   r%   r*   r.   __static_attributes__ r   r   r   r   	   sS    
 DH	  b+//"@"@@A	&, !r   r   oreturnc                    [        U [        5      (       a  [        U 5      $ [        U [        5      (       a   [	        U 5        U $ [        U [        5      (       a  [        S U  5       5      $ [        U [        5      (       a<  [        5       nU R                  5        H  u  p#[        U5      X'   M     [        US5      $ U $ ! [
         a    [        S U  5       5      s $ f = f)z+
Convert mutable types to immutable types.
c              3   8   #    U  H  n[        U5      v   M     g 7fr   constify.0elts     r   	<genexpr>constify.<locals>.<genexpr><   s     4!3#!   c              3   8   #    U  H  n[        U5      v   M     g 7fr   r<   r>   s     r   rA   rB   >   s     0asXc]]arC   T)r   	bytearraybytestupler!   	Exceptionlistr4   itemsr=   r   )r8   cdictkvs       r   r=   r=   1   s     !YQx!U	5GH !T0a000!TGGIDA{EH E4  H  	54!444	5s   B> >CC)collections.abcr   typingr   r   dns._immutable_ctxr   r   Mappingr   r=   r7   r   r   <module>rR      sI       ( $!;??"" $! $!N  r   