³ò ”,9Mc@sdZddklZyddklZlZWngej o[d„Zd„ZyeefWn1e j o%ddjddjf\ZZnXnXddd gZ de fd „ƒYZ d e fd „ƒYZ de fd „ƒYZd e fd„ƒYZdS(såClasses to represent arbitrary sets (including sets of sets). This module implements sets using dictionaries whose values are ignored. The usual operations (union, intersection, deletion, etc.) are provided as both methods and operators. Important: sets are not sequences! While they support 'x in s', 'len(s)', and 'for x in s', none of those operations are unique for sequences; for example, mappings support all three as well. The characteristic operation for sequences is subscripting with small integers: s[i], for i in range(len(s)). Sets don't support subscripting at all. Also, sequences allow multiple occurrences and their elements have a definite order; sets on the other hand don't record multiple occurrences and don't remember the order of element insertion (which is why they don't support s[i]). The following classes are provided: BaseSet -- All the operations common to both mutable and immutable sets. This is an abstract class, not meant to be directly instantiated. Set -- Mutable sets, subclass of BaseSet; not hashable. ImmutableSet -- Immutable sets, subclass of BaseSet; hashable. An iterable argument is mandatory to create an ImmutableSet. _TemporarilyImmutableSet -- A wrapper around a Set, hashable, giving the same hash value as the immutable set equivalent would have. Do not use this class directly. Only hashable objects can be added to a Set. In particular, you cannot really add a Set as an element to another Set; if you try, what is actually added is an ImmutableSet built from it (it compares equal to the one you tried adding). When you ask if `x in y' where x is a Set and y is a Set or ImmutableSet, x is wrapped into a _TemporarilyImmutableSet z, and what's tested is actually `z in y'. iÿÿÿÿ(t generators(tifiltert ifilterfalseccsE|djo d„}nx$|D]}||ƒo |Vq!q!WdS(NcSs|S(N((tx((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt predicate@s(tNone(RtiterableR((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR>s    ccsE|djo d„}nx$|D]}||ƒp |Vq!q!WdS(NcSs|S(N((R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRGs(R(RRR((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyREs    itBaseSettSett ImmutableSetcBseZdZdgZd„Zd„Zd„ZeZed„Z d„Z d„Z d„Z d „Z d „ZeZd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeZeZd„Zd„Zd„Z d„Z!d„Z"RS(s1Common base class for mutable and immutable sets.t_datacCs!|itjo td‚ndS(sThis is an abstract class.s7BaseSet is an abstract class. Use Set or ImmutableSet.N(t __class__Rt TypeError(tself((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__init__ZscCs t|iƒS(s'Return the number of elements of a set.(tlenR (R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__len__cscCs |iƒS(seReturn string representation of a set. This looks like 'Set([])'. (t_repr(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__repr__gscCs8|iiƒ}|o|iƒnd|ii|fS(Ns%s(%r)(R tkeystsortR t__name__(R tsortedtelements((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRqscCs |iiƒS(ssReturn an iterator over the elements or a set. This is the keys iterator for the underlying dict. (R titerkeys(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__iter__wscCs td‚dS(Nscan't compare sets using cmp()(R (R tother((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__cmp__ƒscCs,t|tƒo|i|ijSntSdS(N(t isinstanceRR tFalse(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__eq__•scCs,t|tƒo|i|ijSntSdS(N(RRR tTrue(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__ne__›scCs#|iƒ}|ii|iƒ|S(sReturn a shallow copy of a set.(R R tupdate(R tresult((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pytcopy£s cCscddkl}|iƒ}||t|ƒ<|i}t}x!|D]}|||||ƒR?((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR.ds8    (#Rt __module__t__doc__t __slots__RRRt__str__RRRRRR R#t__copy__R*R-R,R0R/R6R5R;R:R@RBRCt__le__t__ge__RDRERARGR.(((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRSs@                  cBs>eZdZdgZdd„Zd„Zd„Zd„ZRS(sImmutable set class.t _hashcodecCs4d|_h|_|dj o|i|ƒndS(s5Construct an immutable set from an optional iterable.N(RRVR R.(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRs   cCs*|idjo|iƒ|_n|iS(N(RVRRG(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__hash__—scCs|i|ifS(N(R RV(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt __getstate__œscCs|\|_|_dS(N(R RV(R tstate((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt __setstate__ŸsN( RRORPRQRRRWRXRZ(((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR ‰s     cBsËeZdZgZdd„Zd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(s Mutable set class.cCs+h|_|dj o|i|ƒndS(s*Construct a set from an optional iterable.N(R RR.(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR©s  cCs |ifS(N(R (R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRX¯scCs|\|_dS(N(R (R R'((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRZ³scCs td‚dS(sA Set cannot be hashed.s'Can't hash a Set, only an ImmutableSet.N(R (R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRW¶scCs$|i|ƒ|ii|iƒ|S(s2Update a set with the union of itself and another.(RAR R!(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__ior__Às cCs|i|ƒdS(s2Update a set with the union of itself and another.N(R.(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt union_updateÆscCs!|i|ƒ||@i|_|S(s9Update a set with the intersection of itself and another.(RAR (R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__iand__Ês cCs7t|tƒo||M}n|i|ƒi|_dS(s9Update a set with the intersection of itself and another.N(RRR/R (R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pytintersection_updateÐscCs|i|ƒ|i|ƒ|S(sAUpdate a set with the symmetric difference of itself and another.(RAtsymmetric_difference_update(R R((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyt__ixor__×s  cCs|i}t}t|tƒpt|ƒ}n||jo|iƒnx0|D](}||jo ||=qQ|||R?((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pytadds cCs[y|i|=WnFtj o:t|ddƒ}|djo‚n|i|ƒ=nXdS(svRemove an element from a set; it must be a member. If the element is not a member, raise a KeyError. R<N(R R R=R(R R>R?((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pytremoves cCs+y|i|ƒWntj onXdS(smRemove an element from a set if it is a member. If the element is not a member, do nothing. N(RetKeyError(R R>((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pytdiscard!scCs|iiƒdS(s+Remove and return an arbitrary set element.i(R tpopitem(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pytpop+scCs t|ƒS(N(R (R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRH/scCs t|ƒS(N(t_TemporarilyImmutableSet(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR<3sN(RRORPRQRRRXRZRWR[R\R]R^R`R_RcRbR!RaRdReRgRiRHR<(((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR¢s,              RjcBseZd„Zd„ZRS(cCs||_|i|_dS(N(t_setR (R tset((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyR<s cCs |iiƒS(N(RkRG(R ((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRW@s(RRORRW(((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pyRj8s N(RPt __future__Rt itertoolsRRt ImportErrorRRt NameErrort__all__tobjectRR RRj(((s=install/lib/scons-1.2.0.d20100117/SCons/compat/_scons_sets.pys)s   (ÿ7–