3 ุ ๗^Ic@s2ddlmZdgZGdd„dƒZGdd„dƒZdS)้ฉฺrefฺWeakSetc@s$eZdZdd„Zdd„Zdd„ZdS)ฺ_IterationGuardcCst|ƒ|_dSฉN)rฺ weakcontainer)ฺselfrฉr๚#/usr/lib64/python3.6/_weakrefset.pyฺ__init__sz_IterationGuard.__init__cCs |jƒ}|dk r|jj|ƒ|Sr)rฺ _iteratingฺadd)rฺwrrr ฺ __enter__s z_IterationGuard.__enter__cCs0|jƒ}|dk r,|j}|j|ƒ|s,|jƒdSr)rr ฺremoveฺ_commit_removals)rฺeZtZbr ฺsrrr ฺ__exit__s  z_IterationGuard.__exit__N)ฺ__name__ฺ __module__ฺ __qualname__r rrrrrr r src@seZdZd>dd„Zdd„Zdd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„ZeZd d!„Zd"d#„Zd$d%„ZeZd&d'„Zd(d)„Zd*d+„ZeZd,d-„Zd.d/„ZeZd0d1„Zd2d3„Zd4d5„Z e Z!d6d7„Z"d8d9„Z#d:d;„Z$e$Z%d|j|ƒdS)NcSs2|ƒ}|dk r.|jr"|jj|ƒn |jj|ƒdSr)r ฺ_pending_removalsZappendฺdataฺdiscard)ฺitemZselfrefrrrr ฺ_remove&s z!WeakSet.__init__.._remove)ฺsetrrrrr ฺupdate)rrrrrr r $szWeakSet.__init__cCs(|j}|jj}x|r"||jƒƒqWdSr)rrrฺpop)rZlrrrr r4szWeakSet._commit_removalsc cs<t|ƒ*x"|jD]}|ƒ}|dk r|VqWWdQRXdSr)rrฉrZitemrefrrrr ฺ__iter__:s   zWeakSet.__iter__cCst|jƒt|jƒSr)ฺlenrrฉrrrr ฺ__len__C๓zWeakSet.__len__c Cs,y t|ƒ}Wntk r dSX||jkS)NF)rZ TypeErrorr)rrZwrrrr ฺ __contains__Fs  zWeakSet.__contains__cCs|jt|ƒft|ddƒfS)NZ__dict__)ฺ __class__ZlistZgetattrr"rrr ฺ __reduce__Ms zWeakSet.__reduce__cCs&|jr|jƒ|jjt||jƒƒdSr)rrrr rrฉrrrrr r Q๓z WeakSet.addcCs|jr|jƒ|jjƒdSr)rrrฺclearr"rrr r*Vr)z WeakSet.clearcCs |j|ƒSrฉr&r"rrr ฺcopy[r$z WeakSet.copyc CsV|jr|jƒxBy|jjƒ}Wntk r:tdƒ‚YnX|ƒ}|dk r|SqWdS)Nzpop from empty WeakSet)rrrrZKeyErrorrrrr r^sz WeakSet.popcC๓"|jr|jƒ|jjt|ƒƒdSr)rrrrrr(rrr rjr)zWeakSet.removecCr-r)rrrrrr(rrr ror)zWeakSet.discardcCs*|jr|jƒx|D]}|j|ƒqWdSr)rrr )rฺotherZelementrrr rts zWeakSet.updatecCs|j|ƒ|Sr)rฉrr.rrr ฺ__ior__zs zWeakSet.__ior__cC๓|jƒ}|j|ƒ|Sr)r,ฺdifference_updateฉrr.Znewsetrrr ฺ difference~๓ zWeakSet.differencecC๓|j|ƒdSr)ฺ__isub__r/rrr r2„r$zWeakSet.difference_updatecCs<|jr|jƒ||kr"|jjƒn|jjdd„|Dƒƒ|S)Ncs๓|]}t|ƒVqdSrrฉฺ.0rrrr ๚ Œ๓z#WeakSet.__isub__..)rrrr*r2r/rrr r7†s  zWeakSet.__isub__csˆj‡fdd„|DƒƒS)Nc3s|]}|ˆkr|VqdSrrr9r"rr r;r<z'WeakSet.intersection..r+r/rr"r ฺ intersectionr$zWeakSet.intersectioncCr6r)ฺ__iand__r/rrr ฺintersection_update“r$zWeakSet.intersection_updatecCs(|jr|jƒ|jjdd„|Dƒƒ|S)Ncsr8rrr9rrr r;˜r<z#WeakSet.__iand__..)rrrr?r/rrr r>•szWeakSet.__iand__cC๓|jjdd„|DƒƒS)Ncsr8rrr9rrr r;œr<z#WeakSet.issubset..)rฺissubsetr/rrr rA›r$zWeakSet.issubsetcCs|jtdd„|DƒƒkS)Ncsr8rrr9rrr r; r<z!WeakSet.__lt__..ฉrrr/rrr ฺ__lt__Ÿr$zWeakSet.__lt__cCr@)Ncsr8rrr9rrr r;ฃr<z%WeakSet.issuperset..)rฺ issupersetr/rrr rDขr$zWeakSet.issupersetcCs|jtdd„|DƒƒkS)Ncsr8rrr9rrr r;งr<z!WeakSet.__gt__..rBr/rrr ฺ__gt__ฆr$zWeakSet.__gt__cCs(t||jƒstS|jtdd„|DƒƒkS)Ncsr8rrr9rrr r;ฌr<z!WeakSet.__eq__..)Z isinstancer&ZNotImplementedrrr/rrr ฺ__eq__ฉs zWeakSet.__eq__cCr1r)r,ฺsymmetric_difference_updater3rrr ฺsymmetric_differenceฎr5zWeakSet.symmetric_differencecCr6r)ฺ__ixor__r/rrr rGดr$z#WeakSet.symmetric_difference_updatecs@ˆjrˆjƒˆ|kr"ˆjjƒnˆjj‡fdd„|DƒƒˆS)Nc3s|]}t|ˆjƒVqdSr)rrr9r"rr r;ผr<z#WeakSet.__ixor__..)rrrr*rGr/rr"r rIถs  zWeakSet.__ixor__cCs|jdd„||fDƒƒS)Ncss|]}|D] }|Vq qdSrr)r:rrrrr r;ภr<z WeakSet.union..r+r/rrr ฺunionฟr$z WeakSet.unioncCst|j|ƒƒdkS)Nr)r!r=r/rrr ฺ isdisjointรr$zWeakSet.isdisjointr)'rrrr rr r#r%r'r r*r,rrrrr0r4Z__sub__r2r7r=Z__and__r?r>rAZ__le__rCrDZ__ge__rErFrHZ__xor__rGrIrJZ__or__rKrrrr r#sH     N)Z_weakrefrZ__all__rrrrrr Zs