File: //home/arjun/projects/env/lib64/python3.10/site-packages/dns/__pycache__/immutable.cpython-310.pyc
o
!we, � @ sN d dl Zd dlmZ d dlmZ eG dd� dejj��Zdedefdd �Z dS )
� N)�Any)� immutablec @ s@ e Zd Zddedefdd�Zdd� Zdd � Zd
d� Zdd
� Z dS )�DictF�
dictionary�no_copyc C s* |rt |t�r|| _nt|�| _d| _dS )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�dict�_odict�_hash)�selfr r � r �F/home/arjun/projects/env/lib/python3.10/site-packages/dns/immutable.py�__init__ s
z
Dict.__init__c C s | j �|�S �N)r �__getitem__)r �keyr r r
r s zDict.__getitem__c C sB | j d u rd}t| j�� �D ]}|t|�N }qt�| d|� | j S )Nr r
)r
�sortedr �keys�hash�object�__setattr__)r �hr r r r
�__hash__ s
z
Dict.__hash__c C �
t | j�S r )�lenr �r r r r
�__len__$ �
zDict.__len__c C r r )�iterr r r r r
�__iter__'