HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/dns/__pycache__/immutable.cpython-310.pyc
o

!we,�@sNddlZddlmZddlmZeGdd�dejj��Zdedefdd	�Z	dS)
�N)�Any)�	immutablec@s@eZdZddedefdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�DictF�
dictionary�no_copycCs*|rt|t�r||_nt|�|_d|_dS)aMake 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�dict�_odict�_hash)�selfrr�r�F/home/arjun/projects/env/lib/python3.10/site-packages/dns/immutable.py�__init__s

z
Dict.__init__cCs|j�|�S�N)r	�__getitem__)r�keyrrr
rszDict.__getitem__cCsB|jdurd}t|j���D]}|t|�N}qt�|d|�|jS)Nrr
)r
�sortedr	�keys�hash�object�__setattr__)r�hrrrr
�__hash__s
z
Dict.__hash__cC�
t|j�Sr)�lenr	�rrrr
�__len__$�
zDict.__len__cCrr)�iterr	rrrr
�__iter__'rz
Dict.__iter__N)F)
�__name__�
__module__�__qualname__r�boolrrrrrrrrr
r	s
	r�o�returncCs�t|t�r	t|�St|t�r(zt|�|WSty'tdd�|D��YSwt|t�r6tdd�|D��St|t�rRt�}|��D]
\}}t	|�||<qBt
|d�S|S)z3
    Convert mutable types to immutable types.
    cs��|]}t|�VqdSr��constify��.0�eltrrr
�	<genexpr>6��zconstify.<locals>.<genexpr>csr&rr'r)rrr
r,8r-T)r�	bytearray�bytes�tupler�	Exception�listr�itemsr(r)r$�cdict�k�vrrr
r(+s"

�


r()
�collections.abc�collections�typingr�dns._immutable_ctxr�abc�Mappingrr(rrrr
�<module>s!