e T2SrSSKJrJrJrJrJrJrJrJ r SSK J r J r SSK r SSKrSSKr\\4r/SQr\ R$R'\ 5 "SS\5r"SS \ R*5r"S S \5r"S S \ R*5r"SS5rg)ztWeak reference support for Python. This module is an implementation of PEP 205: https://peps.python.org/pep-0205/ )getweakrefcount getweakrefsrefproxyCallableProxyType ProxyType ReferenceType_remove_dead_weakref)WeakSet_IterationGuardN) rrrrWeakKeyDictionaryr rr ProxyTypesWeakValueDictionaryr WeakMethodfinalizec^^\rSrSrSrSrS SjrU4SjrSrSr \ Rr Sr U=r $) r&z A custom `weakref.ref` subclass which simulates a weak reference to a bound method, working around the lifetime problem of bound methods. ) _func_ref _meth_type_alive __weakref__c@^^URnURnUU4Sjn[ R"XU5n[ XE5Ul[ U5Ul SUl [ U5mU$![a% [SR [ U555Sef=f)Nz)argument should be a bound method, not {}c^>T"5nUR(aSUlTb T"U5 gggNF)r)argselfcallbackself_wrs -/opt/imh/python3.13/lib/python3.13/weakref.py_cbWeakMethod.__new__.._cb5s19D{{# 'TN(T) __self____func__AttributeError TypeErrorformattyper__new__rrr)clsmethrobjfuncr rrs ` @rr)WeakMethod.__new__.s ;--C==D #{{3S)Tt* d) ! ;G#VDJ/16: ; ;s A../Bcp>[TU]5nUR5nUbUcgURX!5$N)super__call__rr)rr,r- __class__s rr2WeakMethod.__call__Ds7g ~~ ;$,t))r"c[U[5(a[UR(aUR(dXL$[R"X5=(a UR UR :H$[ $r0) isinstancerrr__eq__rNotImplementedrothers rr7WeakMethod.__eq__KsK eZ ( (;;ell}$::d*Pt~~/P Pr"c[U[5(a[UR(aUR(dXL$[R"X5=(d UR UR :g$[ $r0)r6rrr__ne__rr8r9s rr=WeakMethod.__ne__RsL eZ ( (;;ell((::d*Odnn.O Or")rrrr0)__name__ __module__ __qualname____firstlineno____doc__ __slots__r)r2r7r=r__hash____static_attributes__ __classcell__r3s@rrr&s/ CI,*||Hr"rc\rSrSrSrSSjr\4SjrSrSr Sr Sr S r S r S r\rS rSSjrSrSr\rSrSrSrSrSSjrSSjrSrSrSrSrSrg )r\zMapping class that references values weakly. Entries in the dictionary will be discarded when no strong reference to the value exists anymore c [U5[4SjnX0l/Ul[ 5Ul0UlUR"U40UD6 g)NcU"5nUbUUR(a&URRUR5 gU"URUR5 ggr0) _iterating_pending_removalsappendkeydata)wrselfref_atomic_removalrs rremove,WeakValueDictionary.__init__..removeisG9D??**11"&&9$DIIrvv6  r")rr _removerNsetrMrQupdate)rr:kwrUs r__init__WeakValueDictionary.__init__hsA"4y:N 7 !#%  E R r"cURRnURnU"5nU"X45 M![a gf=fr0)rNpoprQ IndexError)rrTr^drPs r_commit_removals$WeakValueDictionary._commit_removalsysP$$(( II e A #   s6 AAcUR(aUR5 URU"5nUc [U5eU$r0rNrarQKeyErrorrrPos r __getitem__WeakValueDictionary.__getitem__s;  ! !  ! ! # IIcN  93- Hr"c`UR(aUR5 URU gr0)rNrarQrrPs r __delitem__WeakValueDictionary.__delitem__s"  ! !  ! ! # IIcNr"cnUR(aUR5 [UR5$r0)rNralenrQrs r__len__WeakValueDictionary.__len__s%  ! !  ! ! #499~r"cUR(aUR5 URU"5nUSL$![a gf=frrdrfs r __contains__ WeakValueDictionary.__contains__sL  ! !  ! ! #  # A}  s; AAcJSURR[U54-$Nz <%s at %#x>r3r?idrps r__repr__WeakValueDictionary.__repr__  7 7DBBBr"cUR(aUR5 [X RU5URU'gr0)rNraKeyedRefrWrQrrPvalues r __setitem__WeakValueDictionary.__setitem__s/  ! !  ! ! #!%s; #r"cUR(aUR5 [5n[U5 URR 5Hup#U"5nUcMXAU'M SSS5 U$!,(df  U$=fr0)rNrarr rQitems)rnewrPrRrgs rcopyWeakValueDictionary.copysm  ! !  ! ! #!# T "99??,D= H-#  # "  s(A5#A55 Bc2SSKJn UR(aUR5 UR 5n[ U5 UR R5HupEU"5nUcMXcU"XA5'M SSS5 U$!,(df  U$=fNr)deepcopy)rrrNrar3r rQr)rmemorrrPrRrgs r __deepcopy__ WeakValueDictionary.__deepcopy__sz!  ! !  ! ! #nn T "99??,D=/0+,-#  # "  s(B/B BNcUR(aUR5 URUnU"5nUcU$U$![a Us$f=fr0rd)rrPdefaultrRrgs rgetWeakValueDictionary.getsW  ! !  ! ! # 3BAy N sA AAc## UR(aUR5 [U5 URR 5HupU"5nUcMX4v M SSS5 g!,(df  g=f7fr0rNrar rQr)rkrRvs rrWeakValueDictionary.itemssW  ! !  ! ! # T "*D=$J+# " "s"-A>(A- A-$ A>- A;7A>c## UR(aUR5 [U5 URR 5HupU"5cMUv M SSS5 g!,(df  g=f7fr0r)rrrRs rkeysWeakValueDictionary.keyssQ  ! !  ! ! # T "*4#G+# " ""-A;&A*A*! A;* A84A;c## UR(aUR5 [U5 URR 5ShvN SSS5 gN !,(df  g=f7f)a`Return an iterator that yields the weak references to the values. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the values around longer than needed. NrNrar rQvaluesrps r itervaluerefs!WeakValueDictionary.itervaluerefssM  ! !  ! ! # T "yy'') ) )# " )# "s.-A.A AA A.A A+'A.c## UR(aUR5 [U5 URR 5HnU"5nUcMUv M SSS5 g!,(df  g=f7fr0rrrRr,s rrWeakValueDictionary.valuessU  ! !  ! ! # T "ii&&(d?I)# " "rcUR(aUR5 URR5upU"5nUbX4$M+r0)rNrarQpopitem)rrPrRrgs rrWeakValueDictionary.popitemsF  ! !  ! ! #ii'')GCA}v r"cUR(aUR5 URRU5"5nUcU(aUS$[ U5eU$![a SnN*f=f)Nr)rNrarQr^re)rrPargsrgs rr^WeakValueDictionary.popsi  ! !  ! ! #  c"$A 9Awsm#H A s A A.-A.cURU"5nUcFUR(aUR5 [ X R U5URU'U$U$![a SnNYf=fr0)rQrerNrar~rW)rrPrrgs r setdefaultWeakValueDictionary.setdefaultsk  # A 9%%%%'%g||SADIIcNNH A sA!! A0/A0c `UR(aUR5 URnUbM[US5(d [ U5nUR 5HupE[ XPRU5X4'M UR 5HupE[ XPRU5X4'M gNr)rNrarQhasattrdictrr~rW)rr:kwargsr`rPrgs rrYWeakValueDictionary.update!s  ! !  ! ! # II  5'**U ++-!!\\37(llnFCas3AF%r"cUR(aUR5 [URR 55$)aNReturn a list of weak references to the values. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the values around longer than needed. )rNralistrQrrps r valuerefsWeakValueDictionary.valuerefs-s1  ! !  ! ! #DII$$&''r"c(URU5 U$r0rYr9s r__ior__WeakValueDictionary.__ior__; E r"c[U[R5(a#UR5nUR U5 U$[ $r0r6_collections_abcMappingrrYr8rr:cs r__or__WeakValueDictionary.__or__?7 e-55 6 6 A HHUOHr"c[U[R5(a4UR5nUR U5 UR U5 U$[ $r0r6rrr3rYr8rs r__ror__WeakValueDictionary.__ror__FC e-55 6 6 A HHUO HHTNHr")rMrNrWrQ)r0) r?r@rArBrCr[r rarhrlrqrtrzrr__copy__rrrr__iter__rrrr^rrYrrrrrFrr"rrr\s!"0D $  C< H  H *   4 (r"rc6^\rSrSrSrSrSrU4SjrSrU=r $)r~iOaGSpecialized reference that includes a key corresponding to the value. This is used in the WeakValueDictionary to avoid having to create a function object for each key stored in the mapping. A shared callback object can use the 'key' attribute of a KeyedRef instead of getting a reference to the key from an enclosing scope. rPc@[R"XU5nX4lU$r0)rr)rP)r(obrrPrs rr)KeyedRef.__new__[s{{4X. r"c$>[TU]X5 gr0)r1r[)rrrrPr3s rr[KeyedRef.__init__`s &r") r?r@rArBrCrDr)r[rFrGrHs@rr~r~OsI ''r"r~c\rSrSrSrSSjrSrSrSrSr S r S r S r S r \ rS rSSjrSrSrSr\rSrSrSrSrSSjrSSjrSrSrSrSrg)r idalMapping class that references keys weakly. Entries in the dictionary will be discarded when there is no longer a strong reference to the key. This can be used to associate additional data with an object owned by other parts of an application without adding attributes to those objects. This can be especially useful with objects that override attribute accesses. Nc0Ul[U54SjnX l/Ul[ 5UlSUlUbURU5 gg)NcU"5nUb<UR(aURRU5 gURU gg![a gf=fr0)rMrNrOrQre)rrSrs rrU*WeakKeyDictionary.__init__..removeqsS9D??**11!4 IIaL  $s A AAF)rQrrWrNrXrM _dirty_lenrY)rrrUs rr[WeakKeyDictionary.__init__osK !$i  !#%   KK  r"cURRnURnU"5nX# M ![a gf=f![a Nf=fr0)rNr^rQr_re)rr^r`rPs rra"WeakKeyDictionary._commit_removalssc $$(( II e F     s1A >> A AcURnURVs/sH o"U;dM UPM snUlSUlgs snfr)rQrNr)rr`rs r_scrub_removals!WeakKeyDictionary._scrub_removalss; II-1-C-C!N-CAv!-C!N"Os >>c>SUlUR[U5 gNT)rrQrrks rrlWeakKeyDictionary.__delitem__s IIc#h r"c2UR[U5$r0)rQrrks rrhWeakKeyDictionary.__getitem__syyS""r"cUR(a!UR(aUR5 [UR5[UR5- $r0)rrNrrorQrps rrqWeakKeyDictionary.__len__s= ??t55  "499~D$:$: ;;;r"cJSURR[U54-$rwrxrps rrzWeakKeyDictionary.__repr__r|r"cFX R[XR5'gr0)rQrrWrs rrWeakKeyDictionary.__setitem__s,1 #c<<()r"c[5n[U5 URR5Hup#U"5nUcMX1U'M SSS5 U$!,(df  U$=fr0)r r rQr)rrrPrrgs rrWeakKeyDictionary.copysX! T ""iioo/ E="F0#  # "  s(AA A#cSSKJn UR5n[U5 URR 5HupEU"5nUcMU"XQ5X6'M SSS5 U$!,(df  U$=fr)rrr3r rQr)rrrrrPrrgs rrWeakKeyDictionary.__deepcopy__sd!nn T ""iioo/ E=%e2CF0#  # "  s(A&A&& A5cLURR[U5U5$r0)rQrrrrPrs rrWeakKeyDictionary.getsyy}}SXg..r"cV[U5nX R;$![a gf=fr)rr&rQ)rrPrRs rrtWeakKeyDictionary.__contains__s2 SBYY  s  ((c## [U5 URR5HupU"5nUcMX24v M SSS5 g!,(df  g=f7fr0r rQr)rrRrrPs rrWeakKeyDictionary.itemssC T "!YY__. d?*$/# " "s! A(A  A  A AAc## [U5 URHnU"5nUcMUv M SSS5 g!,(df  g=f7fr0)r rQrs rrWeakKeyDictionary.keyss7 T "iid?I # " "s A ;; A  A A c## [U5 URR5HupU"5cMUv M SSS5 g!,(df  g=f7fr0r)rrRrs rrWeakKeyDictionary.valuess< T "!YY__. 4#K/# " "s! A&A A  A AAc,[UR5$)aJReturn a list of weak references to the keys. The references are not guaranteed to be 'live' at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the keys around longer than needed. )rrQrps rkeyrefsWeakKeyDictionary.keyrefssDIIr"chSUlURR5upU"5nUbX24$M+r)rrQr)rrPrrgs rrWeakKeyDictionary.popitems8**,JCA}x r"c\SUlURR"[U5/UQ76$r)rrQr^r)rrPrs rr^WeakKeyDictionary.pops%yy}}SX---r"c`URR[XR5U5$r0)rQrrrWrs rrWeakKeyDictionary.setdefaults"yy##C\\$:7CCr"c URnUbR[US5(d[05"U5nUR5HupEXS[ X@R 5'M [ U5(aURU5 ggr)rQrr(rrrWrorY)rrrr`rPrs rrYWeakKeyDictionary.updatesh II  4))Bx~"jjl ,1#c<<()+ v;; KK  r"c(URU5 U$r0rr9s rrWeakKeyDictionary.__ior__rr"c[U[R5(a#UR5nUR U5 U$[ $r0rrs rrWeakKeyDictionary.__or__ rr"c[U[R5(a4UR5nUR U5 UR U5 U$[ $r0rrs rrWeakKeyDictionary.__ror__rr")rrMrNrWrQr0)r?r@rArBrCr[rarrlrhrqrzrrrrrrtrrrrrrr^rrYrrrrFrr"rr r ds($  #<C2H/%H  .D r"r c\rSrSrSrSr0rSr\R"5r Sr Sr "SS5r SrSS jrS rS r\S 5r\S 5r\R*S5rSr\S5r\S5rSrg)riaClass for finalization of weakrefable objects finalize(obj, func, *args, **kwargs) returns a callable finalizer object which will be called when obj is garbage collected. The first time the finalizer is called it evaluates func(*arg, **kwargs) and returns the result. After this the finalizer is dead, and calling it just returns None. When the program exits any remaining finalizers for which the atexit attribute is true will be run in reverse order of creation. By default atexit is true. rFc\rSrSrSrSrg)finalize._Infoi5)weakrefr-rratexitindexrN)r?r@rArBrDrFrr"r_Infor 5sL r"rcfUR(d*SSKnURUR5 S[lUR 5n[ X5UlX&lX6l U=(d SUl SUl[UR5Ul X`RU'S[lg)NrT)_registered_with_atexitrregister _exitfuncrrrr r-rrnext _index_iterr _registry_dirty)rr,r-rrrinfos rr[finalize.__init__8s++  OODNN +/3H ,zz|3~   n  $**+ #tr"NcURRUS5nU(aAUR(d/UR"UR0UR =(d 0D6$gg)zRIf alive then mark as dead and return func(*args, **kwargs); otherwise return NoneN)rr^ _shutdownr-rr)r_rs rr2finalize.__call__IsK~~!!$- 99dii?DKK,=2? ?'4r"cURRU5nU=(a UR5nUbNURRUS5(a,X!RUR UR =(d 04$gg)zVIf alive then mark as dead and return (obj, func, args, kwargs); otherwise return NoneN)rrr r^r-rrrrr,s rdetachfinalize.detachPsh~~!!$'%t||~ ?t~~11$==DIIt{{/@bA A >?r"cURRU5nU=(a UR5nUb,X!RURUR =(d 04$g)zEIf alive then return (obj, func, args, kwargs); otherwise return NoneN)rrr r-rrr s rpeek finalize.peekXsP~~!!$'%t||~ ?DIIt{{/@bA A r"cXR;$)zWhether finalizer is alive)rrps ralivefinalize.alive`s~~%%r"ctURRU5n[U5=(a UR$)z*Whether finalizer should be called at exitrrboolr)rrs rrfinalize.atexites+~~!!$'Dz)dkk)r"cjURRU5nU(a[U5Ulggr0r*)rrrs rrr,ks)~~!!$' u+DK r"c8URRU5nU=(a UR5nUc#S[U5R[ U54-$S[U5R[ U5[U5R[ U54-$)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)rrr r(r?ryr s rrzfinalize.__repr__qs~~!!$'%t||~ ;-d1D1Dbh0OO O6d$$bhS 0B0BBsGLM Mr"cURR5VVs/sHupUR(dMX4PM nnnURSS9 UVVs/sHupUPM snn$s snnfs snnf)Nc USR$)N)r)items r+finalize._select_for_exit..~s tAw}}r"r)rrrsort)r*fiLs r_select_for_exitfinalize._select_for_exitzsb!$ 3 3 5 B 5uUaU 5 B ,- !qeqq!! C!sA*A*A0cVSnUR(aSSKnUR5(aSnUR5 SnUb[R (aUR 5nS[lU(dO+UR5nU"5 X@R;deMfS[l U(aWR5 gg![a) [R"[R"56 Nif=f!S[l U(aWR5 ff=f)NFrT)rgc isenableddisablerrr:r^ Exceptionsys excepthookexc_inforenable)r* reenable_gcr=pendingr7s rrfinalize._exitfuncs   }}<<>>"&KJJL(//"%"6"6"8*/" A8 MM111$"&H   %8 78 "&H  s0B DC D 0D=D?DD%D(r0)r?r@rArBrCrDrr itertoolscountrrrrr[r2r!r$propertyr'rsetterrz classmethodr:rrFrr"rrrs "III//#K F#MM"@BB&&**  ]]&& M""   r"r)rC_weakrefrrrrrrr r _weakrefsetr r rrArHr__all__ MutableSetrrMutableMappingrr~r rrr"rrRs1 * +  0 $$W-33lp*99pf's'*u(77upFFr"