File: //lib/python3.9/site-packages/dns/__pycache__/immutable.cpython-39.opt-1.pyc
a
�M�e� � @ sP d dl Zd dlmZmZ d dlmZ eG dd� dejj��Z eed�dd�Z
dS ) � N)�Any�Callable)� immutablec @ sP e Zd Zdefeeeg ejj f d�dd�Z
dd� Zdd� Zd d
� Z
dd� Zd
S )�DictF)�
dictionary�no_copy�map_factoryc C s8 |rt |tjj�r|| _n|� | _| j�|� 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�collections�abc�MutableMapping�_odict�update�_hash)�selfr r r � r �1/usr/lib/python3.9/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 r<d}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 s
t | j�S r )�lenr
�r r r r �__len__* s zDict.__len__c C s
t | j�S r )�iterr
r r r r �__iter__- s z
Dict.__iter__N)�__name__�
__module__�__qualname__�dictr �boolr r
r r r r r r r"