+\h# ddlZGddZy)NceZdZdZdgZd*dZdZdZdZdZ d Z d+d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ d Z!d!Z"d"Z#d#Z$d$Z%d%Z&d&Z'd'Z(d(Z)d)Z*y),SetaA simple set class. This class was originally used to deal with python not having a set class, and originally the class used lists in its implementation. The ordered and indexable nature of RRsets and Rdatasets is unfortunately widely used in dnspython applications, so for backwards compatibility sets continue to be a custom class, now based on an ordered dictionary. itemsNcXt|_||D]}|j|yy)zaInitialize the set. *items*, an iterable or ``None``, the initial set of items. N)dictradd)selfritems J/root/niggaflix-v3/playground/venv/lib/python3.12/site-packages/dns/set.py__init__z Set.__init__!s4 V     cbdtt|jjdS)Nz dns.set.Set())reprlistrkeysr s r __repr__z Set.__repr__.s'd4 (9#:;>r c@||jvrd|j|<yy)zAdd an item to the set.Nrr r s r rzSet.add1s# tzz !#DJJt  "r cF |j|=y#t$rtwxYw)zRemove an item from the set.N)rKeyError ValueErrorrs r removez Set.remove7s(  4    s  c<|jj|dy)z'Remove an item from the set if present.N)rpoprs r discardz Set.discard?s tT"r c@|jj\}}|S)z&Remove an arbitrary item from the set.)rpopitem)r k_s r rzSet.popDs##%Ar ct|dr |j}n |j}|j|}t |_|j j |j |S)aMake a (shallow) copy of the set. There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined in the subclass. This protocol allows us to write the set algorithms that return new instances (e.g. union) once, and keep using them in subclasses. _clone_class)hasattrr$ __class____new__rrupdate)r clsobjs r _clonez Set._cloneIsT 4 (##C..Ckk#F  $ r c"|jSz!Make a (shallow) copy of the set.r+rs r __copy__z Set.__copy___{{}r c"|jSr-r.rs r copyzSet.copydr0r ct|ts td||ury|jD]}|j |y)zaUpdate the set, adding any elements from other which are not already in the set. other must be a Set instanceN) isinstancerrrrr otherr s r union_updatezSet.union_updateisB %%;< < 5= KK D HHTN r ct|ts td||uryt|jD]}||jvs|j|= y)z]Update the set, removing any elements from other which are not in both sets. r4N)r5rrrrr6s r intersection_updatezSet.intersection_updateusV %%;< < 5= $ %D5;;&JJt$ %r ct|ts td||ur|jj y|jD]}|j |y)zWUpdate the set, removing any elements from other which are in the set. r4N)r5rrrclearrr6s r difference_updatezSet.difference_updatesP %%;< < 5= JJ     # T" #r ct|ts td||ur|jj y|j |}|j ||j|y)z? ?r ct|tr!t||D]}|j|=y|j||=yrK)r5rrrr)r ryelts r __delitem__zSet.__delitem__ s@ a DG} $JJsO $ 47#r c|t|ts td|jD]}||jvsyy)zFIs this set a subset of *other*? Returns a ``bool``. r4FTr5rrrr6s r issubsetz Set.issubsetsA %%;< <JJ D5;;& r c|t|ts td|jD]}||jvsyy)zHIs this set a superset of *other*? Returns a ``bool``. r4FTrr6s r issupersetzSet.issuperset!sA %%;< <KK D4::% r c|t|ts td|jD]}||jvsyy)Nr4FTrr6s r isdisjointzSet.isdisjoint.s?%%;< <KK Dtzz! r rK)returnr)+__name__ __module__ __qualname____doc__ __slots__r rrrrrr+r/r2r8r:r=rArDr?rGrIrNrQrSrUrWrZr]r_rarcr(r<rgrirlrorzr}rrrr r rrs I ?$ #  ,   % # ,   !(!&0 )& @ $  r r)rsrrr r rs$__r