ó !`Nc@s dZdefd„ƒYZdS(sA simple Set class.tSetcBsLeZdZdgZd$d„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d „Z#d!„Z$d"„Z%d#„Z&RS(%s'A simple set class. Sets are not in Python until 2.3, and rdata are not immutable so we cannot use sets.Set anyway. This class implements subset of the 2.3 Set interface using a list as the container. @ivar items: A list of the items which are in the set @type items: listtitemscCs:g|_|dk r6x|D]}|j|ƒqWndS(svInitialize the set. @param items: the initial set of items @type items: any iterable or None N(RtNonetadd(tselfRtitem((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__init__s   cCsdt|jƒS(Nsdns.simpleset.Set(%s)(treprR(R((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__repr__*scCs&||jkr"|jj|ƒndS(sAdd an item to the set.N(Rtappend(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyR-scCs|jj|ƒdS(sRemove an item from the set.N(Rtremove(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyR 2scCs,y|jj|ƒWntk r'nXdS(s'Remove an item from the set if present.N(RR t ValueError(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pytdiscard6s cCs.|j}|j|ƒ}t|jƒ|_|S(sÞMake 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. (t __class__t__new__tlistR(Rtclstobj((s-/usr/lib64/python2.7/site-packages/dns/set.pyt_clone=s cCs |jƒS(s!Make a (shallow) copy of the set.(R(R((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__copy__OscCs |jƒS(s!Make a (shallow) copy of the set.(R(R((s-/usr/lib64/python2.7/site-packages/dns/set.pytcopySscCsSt|tƒstdƒ‚n||kr.dSx|jD]}|j|ƒq8WdS(sÌUpdate the set, adding any elements from other which are not already in the set. @param other: the collection of items with which to update the set @type other: Set object sother must be a Set instanceN(t isinstanceRR RR(RtotherR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt union_updateWs  cCsnt|tƒstdƒ‚n||kr.dSx9t|jƒD](}||jkr>|jj|ƒq>q>WdS(sÈUpdate the set, removing any elements from other which are not in both sets. @param other: the collection of items with which to update the set @type other: Set object sother must be a Set instanceN(RRR RRR (RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pytintersection_updateds cCs[t|tƒstdƒ‚n||kr6g|_n!x|jD]}|j|ƒq@WdS(sÂUpdate the set, removing any elements from other which are in the set. @param other: the collection of items with which to update the set @type other: Set object sother must be a Set instanceN(RRR RR (RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pytdifference_updatets   cCs|jƒ}|j|ƒ|S(s³Return a new set which is the union of I{self} and I{other}. @param other: the other set @type other: Set object @rtype: the same type as I{self} (RR(RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pytunion‚s  cCs|jƒ}|j|ƒ|S(sºReturn a new set which is the intersection of I{self} and I{other}. @param other: the other set @type other: Set object @rtype: the same type as I{self} (RR(RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt intersectionŽs  cCs|jƒ}|j|ƒ|S(sãReturn a new set which I{self} - I{other}, i.e. the items in I{self} which are not also in I{other}. @param other: the other set @type other: Set object @rtype: the same type as I{self} (RR(RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt differencešs  cCs |j|ƒS(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__or__§scCs |j|ƒS(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__and__ªscCs |j|ƒS(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__add__­scCs |j|ƒS(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__sub__°scCs|j|ƒ|S(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__ior__³s cCs|j|ƒ|S(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__iand__·s cCs|j|ƒ|S(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__iadd__»s cCs|j|ƒ|S(N(R(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__isub__¿s cCs"x|D]}|j|ƒqWdS(sÊUpdate the set, adding any elements from other which are not already in the set. @param other: the collection of items with which to update the set @type other: any iterable typeN(R(RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pytupdateÃs cCs g|_dS(sMake the set empty.N(R(R((s-/usr/lib64/python2.7/site-packages/dns/set.pytclearËscCsRx$|jD]}||jkr tSq Wx$|jD]}||jkr1tSq1WtS(N(RtFalsetTrue(RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__eq__ÏscCs|j|ƒ S(N(R)(RR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__ne__ÚscCs t|jƒS(N(tlenR(R((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__len__ÝscCs t|jƒS(N(titerR(R((s-/usr/lib64/python2.7/site-packages/dns/set.pyt__iter__àscCs |j|S(N(R(Rti((s-/usr/lib64/python2.7/site-packages/dns/set.pyt __getitem__ãscCs|j|=dS(N(R(RR/((s-/usr/lib64/python2.7/site-packages/dns/set.pyt __delitem__æscCs|j||!S(N(R(RR/tj((s-/usr/lib64/python2.7/site-packages/dns/set.pyt __getslice__éscCs|j||5dS(N(R(RR/R2((s-/usr/lib64/python2.7/site-packages/dns/set.pyt __delslice__ìscCsIt|tƒstdƒ‚nx$|jD]}||jkr(tSq(WtS(s?Is I{self} a subset of I{other}? @rtype: bool sother must be a Set instance(RRR RR'R((RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pytissubsetïs cCsIt|tƒstdƒ‚nx$|jD]}||jkr(tSq(WtS(sAIs I{self} a superset of I{other}? @rtype: bool sother must be a Set instance(RRR RR'R((RRR((s-/usr/lib64/python2.7/site-packages/dns/set.pyt issupersetüs N('t__name__t __module__t__doc__t __slots__RRRRR R RRRRRRRRRRRRR R!R"R#R$R%R&R)R*R,R.R0R1R3R4R5R6(((s-/usr/lib64/python2.7/site-packages/dns/set.pyRsH                            N(R9tobjectR(((s-/usr/lib64/python2.7/site-packages/dns/set.pyts