U mf@s,dZddlmZddlZGdddeZdS)zDNS name dictionary)MutableMappingNcsjeZdZdZdddgZfddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ZS)NameDictzA dictionary whose keys are dns.name.Name objects. In addition to being like a regular Python dictionary, this dictionary can also get the deepest match for a given key. max_depthmax_depth_itemsZ__storecs2tt|_d|_d|_|t||dS)Nr)super__init__dict_NameDict__storerrupdate)selfargskwargs __class__:/opt/hc_python/lib/python3.8/site-packages/dns/namedict.pyr-s  zNameDict.__init__cCs>t||jkr|jd|_nt||jkr:t||_d|_dS)N)lenrrr keyrrrZ__update_max_depth6s  zNameDict.__update_max_depthcCs |j|SNr rrrr __getitem__=szNameDict.__getitem__cCs.t|tjjstd||j|<||dS)NzNameDict key must be a name) isinstancednsnameName ValueErrorr _NameDict__update_max_depth)r rvaluerrr __setitem__@s zNameDict.__setitem__cCsP|j|t||jkr&|jd|_|jdkrLd|_|jD]}||qs