o cc#@s>ddlmZddlmZdgZGdddZGdddZdS)ref) GenericAliasWeakSetc@s$eZdZddZddZddZdS)_IterationGuardcCst||_dSN)r weakcontainer)selfrr l/home/lily/lilypond-2.24.1/release/binaries/dependencies/install/Python-3.10.8/lib/python3.10/_weakrefset.py__init__sz_IterationGuard.__init__cCs |}|dur|j||Sr)r _iteratingadd)r wr r r __enter__s z_IterationGuard.__enter__cCs8|}|dur|j}|||s|dSdSdSr)rr remove_commit_removals)r etbrsr r r __exit__s  z_IterationGuard.__exit__N)__name__ __module__ __qualname__r rrr r r r r s rc@s&eZdZd@ddZddZddZdd 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%dd?Z'e(e)Z*dS)ArNcCsFt|_t|fdd}||_g|_t|_|dur!||dSdS)NcSs8|}|dur|jr|j|dS|j|dSdSr)r _pending_removalsappenddatadiscard)itemselfrefr r r r _remove's z!WeakSet.__init__.._remove)setrrr!rr update)r rr!r r r r %szWeakSet.__init__cCs<|jj}|jj} z|}Wn tyYdSw||q r)rpoprr IndexError)r r$rrr r r r5s  zWeakSet._commit_removalsccsPt||jD] }|}|dur|Vq WddS1s!wYdSr)rrr Zitemrefrr r r __iter__?s  "zWeakSet.__iter__cCst|jt|jSr)lenrrr r r r __len__HzWeakSet.__len__cCs,zt|}Wn tyYdSw||jvS)NF)r TypeErrorr)r rwrr r r __contains__Ks    zWeakSet.__contains__cCs|jt|ft|ddfS)N__dict__) __class__listgetattrr)r r r __reduce__Rs  zWeakSet.__reduce__cCs&|jr||jt||jdSr)rrrrrr!r rr r r rVsz WeakSet.addcCs|jr||jdSr)rrrclearr)r r r r5[sz WeakSet.clearcCs ||Srr0r)r r r copy` z WeakSet.copycCsL|jr| z|j}Wn tytddw|}|dur%|Sq)NTzpop from empty WeakSet)rrrr$KeyErrorr&r r r r$cs  z WeakSet.popcC"|jr||jt|dSr)rrrrrr4r r r rozWeakSet.removecCr:r)rrrrrr4r r r rtr;zWeakSet.discardcCs&|jr||D]}||q dSr)rrr)r otherelementr r r r#ys  zWeakSet.updatecCs|||Sr)r#r r<r r r __ior__s zWeakSet.__ior__cC|}|||Sr)r7difference_updater r<Znewsetr r r difference zWeakSet.differencecC||dSr)__isub__r>r r r rAzWeakSet.difference_updatecCs>|jr|||ur|j|S|jdd|D|S)Ncs|]}t|VqdSrr.0rr r r z#WeakSet.__isub__..)rrrr5rAr>r r r rFs zWeakSet.__isub__csfdd|DS)Nc3s|] }|vr|VqdSrr rIr)r r rKz'WeakSet.intersection..r6r>r r)r intersectionzWeakSet.intersectioncCrEr)__iand__r>r r r intersection_updaterGzWeakSet.intersection_updatecCs(|jr||jdd|D|S)NcsrHrrrIr r r rKrLz#WeakSet.__iand__..)rrrrQr>r r r rPszWeakSet.__iand__cC|jdd|DS)NcsrHrrrIr r r rKrLz#WeakSet.issubset..)rissubsetr>r r r rSzWeakSet.issubsetcCs|jttt|kSrrr"maprr>r r r __lt__r+zWeakSet.__lt__cCrR)NcsrHrrrIr r r rKrLz%WeakSet.issuperset..)r issupersetr>r r r rXrTzWeakSet.issupersetcCs|jttt|kSrrUr>r r r __gt__r+zWeakSet.__gt__cCs$t||jstS|jttt|kSr) isinstancer0NotImplementedrr"rVrr>r r r __eq__s zWeakSet.__eq__cCr@r)r7symmetric_difference_updaterBr r r symmetric_differencerDzWeakSet.symmetric_differencecCrEr)__ixor__r>r r r r]rGz#WeakSet.symmetric_difference_updatecsBjr|urjSjfdd|DS)Nc3s|] }t|jVqdSr)rr!rIr)r r rKrMz#WeakSet.__ixor__..)rrrr5r]r>r r)r r_s zWeakSet.__ixor__cCs|dd||fDS)Ncss|] }|D]}|VqqdSrr )rJrrr r r rKsz WeakSet.union..r6r>r r r unionrOz WeakSet.unioncCst||dkS)Nr)r(rNr>r r r isdisjointszWeakSet.isdisjointcCs t|jSr)reprrr)r r r __repr__r8zWeakSet.__repr__r)+rrrr rr'r*r.r3rr5r7r$rrr#r?rC__sub__rArFrN__and__rQrPrS__le__rWrX__ge__rYr\r^__xor__r]r_r`__or__rarc classmethodr__class_getitem__r r r r r$sN       N)_weakrefrtypesr__all__rrr r r r s