QfJddlmZddlmZdgZGddZGddZy)ref) GenericAliasWeakSetceZdZdZdZdZy)_IterationGuardc$t||_yN)r weakcontainer)selfr s 2/opt/alt/python312/lib64/python3.12/_weakrefset.py__init__z_IterationGuard.__init__s /c`|j}||jj||Sr )r _iteratingadd)r ws r __enter__z_IterationGuard.__enter__s,     = LL  T " rc|j}|1|j}|j||s|jyyyr )r rremove_commit_removals)r etbrss r __exit__z_IterationGuard.__exit__sB     = A HHTN""$ rN)__name__ __module__ __qualname__rrrrr rr s 0 %rrceZdZd!dZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZeZdZdZdZeZdZdZdZeZdZdZeZdZdZdZ e Z!dZ"dZ#dZ$e$Z%dZ&d Z'e(e)Z*y)"rNct|_t|fd}||_g|_t|_||j |yy)Nc|}|D|jr|jj|y|jj |yyr )r_pending_removalsappenddatadiscard)itemselfrefr s r _removez!WeakSet.__init__.._remove'sA9D??**11$7II%%d+  r)setr&rr*r$rupdate)r r&r*s r rzWeakSet.__init__%sHE "%d) , !#%   KK  rc|jj}|jj} |}||#t$rYywxYwr )r$popr&r' IndexError)r r.r'r(s r rzWeakSet._commit_removals5sS$$(())## u DM   s? A  A c#Kt|5|jD]}|}| | dddy#1swYyxYwwr )rr&r itemrefr(s r __iter__zWeakSet.__iter__?s; T "99y#J %# " "s A88 AAAcXt|jt|jz Sr )lenr&r$r s r __len__zWeakSet.__len__Hs 499~D$:$: ;;;rcT t|}||jvS#t$rYywxYw)NF)r TypeErrorr&)r r(wrs r __contains__zWeakSet.__contains__Ks4 TBTYY  s  ''cP|jt|f|jfSr ) __class__list __getstate__r6s r __reduce__zWeakSet.__reduce__Rs"~~T }d.?.?.AAArc|jr|j|jjt ||j yr )r$rr&rrr*r r(s r rz WeakSet.addUs2  ! !  ! ! # c$ -.rcp|jr|j|jjyr )r$rr&clearr6s r rDz WeakSet.clearZs%  ! !  ! ! # rc$|j|Sr r=r6s r copyz WeakSet.copy_s~~d##rc|jr|j |jj}|}||S'#t$r t ddwxYw)Nzpop from empty WeakSet)r$rr&r.KeyErrorr1s r r.z WeakSet.popbsi  ! !  ! ! # C))--/9D  C78dB Cs AAc|jr|j|jjt |yr )r$rr&rrrBs r rzWeakSet.removens-  ! !  ! ! # T#rc|jr|j|jjt |yr )r$rr&r'rrBs r r'zWeakSet.discardss-  ! !  ! ! # #d)$rcl|jr|j|D]}|j|yr )r$rr)r otherelements r r,zWeakSet.updatexs-  ! !  ! ! #G HHW rc(|j||Sr )r,r rMs r __ior__zWeakSet.__ior__~s E rcH|j}|j||Sr )rGdifference_updater rMnewsets r differencezWeakSet.differences   ' rc&|j|yr )__isub__rPs r rSzWeakSet.difference_update erc|jr|j||ur|jj|S|jj d|D|S)Nc32K|]}t|ywr r.0r(s r z#WeakSet.__isub__..s'DedD e)r$rr&rDrSrPs r rXzWeakSet.__isub__sR  ! !  ! ! # 5= IIOO   II ' ''De'D D rc8jfd|DS)Nc3,K|] }|vs| ywr r r]r(r s r r^z'WeakSet.intersection..sEut dus rFrPs` r intersectionzWeakSet.intersections~~EuEEErc&|j|yr )__iand__rPs r intersection_updatezWeakSet.intersection_updaterYrc|jr|j|jjd|D|S)Nc32K|]}t|ywr rr\s r r^z#WeakSet.__iand__..s%BEDc$iEr_)r$rr&rfrPs r rezWeakSet.__iand__s4  ! !  ! ! # %%%BE%BB rcF|jjd|DS)Nc32K|]}t|ywr rr\s r r^z#WeakSet.issubset..s!>#d)r_)r&issubsetrPs r rkzWeakSet.issubsetsyy!!!>!>>>rcN|jttt|kSr r&r+maprrPs r __lt__zWeakSet.__lt__yy3s3///rcF|jjd|DS)Nc32K|]}t|ywr rr\s r r^z%WeakSet.issuperset..s#@%$CI%r_)r& issupersetrPs r rszWeakSet.issupersetsyy###@%#@@@rcN|jttt|kDSr rmrPs r __gt__zWeakSet.__gt__rprct||jstS|jt t t |k(Sr ) isinstancer=NotImplementedr&r+rnrrPs r __eq__zWeakSet.__eq__s0%0! !yyCC000rcH|j}|j||Sr )rGsymmetric_difference_updaterTs r symmetric_differencezWeakSet.symmetric_differences **51 rc&|j|yr )__ixor__rPs r r{z#WeakSet.symmetric_difference_updaterYrcjrj|urjjSjj fd|DS)Nc3JK|]}t|jywr )rr*rbs r r^z#WeakSet.__ixor__..s1\V[d#dDLL2IV[s #)r$rr&rDr{rPs` r r~zWeakSet.__ixor__sT  ! !  ! ! # 5= IIOO   II 1 11\V[1\ \ rc6|jd||fDS)Nc3.K|] }|D]}|ywr r )r]rrs r r^z WeakSet.union..sBA1aasrFrPs r unionz WeakSet.unions~~B$BBBrc<t|j|dk(S)Nr)r5rcrPs r isdisjointzWeakSet.isdisjoints4$$U+,11rc,t|jSr )reprr&r6s r __repr__zWeakSet.__repr__sDIIrr )+rrrrrr3r7r;r@rrDrGr.rr'r,rQrV__sub__rSrXrc__and__rfrerk__le__rors__ge__ruryr|__xor__r{r~r__or__rr classmethodr__class_getitem__r rr rr$s <B/  $ $ %  GFG ? F0A F01 #GC F2$L1rN)_weakrefrtypesr__all__rrr rr rs*  +%%2i2i2r