YfI@sCddlmZdgZGdddZGdddZdS))refWeakSetc@s4eZdZddZddZddZdS)_IterationGuardcCst||_dS)N)r weakcontainer)selfrr0/opt/alt/python35/lib64/python3.5/_weakrefset.py__init__sz_IterationGuard.__init__cCs,|j}|dk r(|jj||S)N)r _iteratingadd)rwrrr __enter__s  z_IterationGuard.__enter__cCsB|j}|dk r>|j}|j||s>|jdS)N)rr remove_commit_removals)retbr srrr__exit__s     z_IterationGuard.__exit__N)__name__ __module__ __qualname__r r rrrrrr s   rc@seZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZddZddZeZd d!Zd"d#Zd$d%ZeZd&d'Zd(d)Zd*d+ZeZd,d-Zd.d/ZeZd0d1Zd2d3Zd4d5Z e Z!d6d7Z"d8d9Z#d:d;Z$e$Z%d<d=Z&dS)>rNcCs\t|_t|dd}||_g|_t|_|dk rX|j|dS)NcSsE|}|dk rA|jr1|jj|n|jj|dS)N)r _pending_removalsappenddatadiscard)itemselfrefrrrr_remove&s    z!WeakSet.__init__.._remove)setrrrrr update)rrrrrrr $s     zWeakSet.__init__cCs6|j}|jj}x|r1||jqWdS)N)rrrpop)rlrrrrr4s   zWeakSet._commit_removalsc csFt|3x+|jD] }|}|dk r|VqWWdQRXdS)N)rr)ritemrefrrrr__iter__:s    zWeakSet.__iter__cCst|jt|jS)N)lenrr)rrrr__len__CszWeakSet.__len__c Cs6yt|}Wntk r(dSYnX||jkS)NF)r TypeErrorr)rrwrrrr __contains__Fs   zWeakSet.__contains__cCs%|jt|ft|ddfS)N__dict__) __class__listgetattr)rrrr __reduce__MszWeakSet.__reduce__cCs3|jr|j|jjt||jdS)N)rrrr rr)rrrrrr Qs  z WeakSet.addcCs$|jr|j|jjdS)N)rrrclear)rrrrr/Vs  z WeakSet.clearcCs |j|S)N)r+)rrrrcopy[sz WeakSet.copyc Csk|jr|jxQy|jj}Wntk rItdYnX|}|dk r|SqWdS)Nzpop from empty WeakSet)rrrr!KeyError)rr#rrrrr!^s     z WeakSet.popcCs-|jr|j|jjt|dS)N)rrrrr)rrrrrrjs  zWeakSet.removecCs-|jr|j|jjt|dS)N)rrrrr)rrrrrros  zWeakSet.discardcCs5|jr|jx|D]}|j|qWdS)N)rrr )rotherelementrrrr ts   zWeakSet.updatecCs|j||S)N)r )rr2rrr__ior__zs zWeakSet.__ior__cCs|j}|j||S)N)r0difference_update)rr2newsetrrr difference~s  zWeakSet.differencecCs|j|dS)N)__isub__)rr2rrrr5szWeakSet.difference_updatecCsP|jr|j||kr/|jjn|jjdd|D|S)Ncss|]}t|VqdS)N)r).0rrrr sz#WeakSet.__isub__..)rrrr/r5)rr2rrrr8s    zWeakSet.__isub__cs jfdd|DS)Nc3s!|]}|kr|VqdS)Nr)r9r)rrrr:sz'WeakSet.intersection..)r+)rr2r)rr intersectionszWeakSet.intersectioncCs|j|dS)N)__iand__)rr2rrrintersection_updateszWeakSet.intersection_updatecCs4|jr|j|jjdd|D|S)Ncss|]}t|VqdS)N)r)r9rrrrr:sz#WeakSet.__iand__..)rrrr=)rr2rrrr<s  zWeakSet.__iand__cCs|jjdd|DS)Ncss|]}t|VqdS)N)r)r9rrrrr:sz#WeakSet.issubset..)rissubset)rr2rrrr>szWeakSet.issubsetcCs |jtdd|DkS)Ncss|]}t|VqdS)N)r)r9rrrrr:sz!WeakSet.__lt__..)rr)rr2rrr__lt__szWeakSet.__lt__cCs|jjdd|DS)Ncss|]}t|VqdS)N)r)r9rrrrr:sz%WeakSet.issuperset..)r issuperset)rr2rrrr@szWeakSet.issupersetcCs |jtdd|DkS)Ncss|]}t|VqdS)N)r)r9rrrrr:sz!WeakSet.__gt__..)rr)rr2rrr__gt__szWeakSet.__gt__cCs6t||jstS|jtdd|DkS)Ncss|]}t|VqdS)N)r)r9rrrrr:sz!WeakSet.__eq__..) isinstancer+NotImplementedrr)rr2rrr__eq__szWeakSet.__eq__cCs|j}|j||S)N)r0symmetric_difference_update)rr2r6rrrsymmetric_differences  zWeakSet.symmetric_differencecCs|j|dS)N)__ixor__)rr2rrrrEsz#WeakSet.symmetric_difference_updatecsVjrj|kr/jjn#jjfdd|DS)Nc3s!|]}t|jVqdS)N)rr)r9r)rrrr:sz#WeakSet.__ixor__..)rrrr/rE)rr2r)rrrGs    #zWeakSet.__ixor__cCs |jdd||fDS)Ncss"|]}|D] }|Vq qdS)Nr)r9rrrrrr:sz WeakSet.union..)r+)rr2rrrunionsz WeakSet.unioncCst|j|dkS)Nr)r%r;)rr2rrr isdisjointszWeakSet.isdisjoint)'rrrr rr$r&r)r.r r/r0r!rrr r4r7__sub__r5r8r;__and__r=r<r>__le__r?r@__ge__rArDrF__xor__rErGrH__or__rIrrrrr#sH                         N)_weakrefr__all__rrrrrrs