4:7 ˆ¾Ã ƒh¹ÂÀÇ0 $ˆl–äY>” je¶…8 Cq§nÅ1hßÄ „óÃÁÈ?÷a ´i8Tã@sÒdZddlmZmZmZmZmZmZmZm Z ddl m Z m Z ddl Z ddlZddlZeefZgd¢Ze j e ¡e j e ¡Gdd„deƒZGdd „d e jƒZGd d „d eƒZGd d „d e jƒZGdd„dƒZdS)z|Weak reference support for Python. This module is an implementation of PEP 205: https://www.python.org/dev/peps/pep-0205/ é)ÚgetweakrefcountÚ getweakrefsÚrefÚproxyÚCallableProxyTypeÚ ProxyTypeÚ ReferenceTypeÚ_remove_dead_weakref)ÚWeakSetÚ_IterationGuardN) rrrrÚWeakKeyDictionaryrrrÚ ProxyTypesÚWeakValueDictionaryr Ú WeakMethodÚfinalizecsDeZdZdZdZd dd„Z‡fdd„Zdd „Zd d „Ze j Z ‡Z S) rz— 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__Ncs|z|j}|j}Wn&ty6td t|ƒ¡ƒd‚Yn0‡‡fdd„}t |||¡}t||ƒ|_t|ƒ|_ d|_ t|ƒ‰|S)Nz)argument should be a bound method, not {}cs&ˆƒ}|jr"d|_ˆdur"ˆ|ƒdS©NF)r)ÚargÚself©ÚcallbackÚself_wr©ú/usr/lib64/python3.9/weakref.pyÚ_cb6s zWeakMethod.__new__.._cbT) Ú__self__Ú__func__ÚAttributeErrorÚ TypeErrorÚformatÚtyperÚ__new__rrr)ÚclsÚmethrÚobjÚfuncrrrrrr$/s   ÿÿ  zWeakMethod.__new__cs2tƒ ¡}| ¡}|dus"|dur&dS| ||¡S©N)ÚsuperÚ__call__rr)rr'r(©Ú __class__rrr+Es  zWeakMethod.__call__cCs:t|tƒr6|jr|js||uSt ||¡o4|j|jkStSr))Ú isinstancerrrÚ__eq__rÚNotImplemented©rÚotherrrrr/Ls   zWeakMethod.__eq__cCs:t|tƒr6|jr|js||uSt ||¡p4|j|jkStSr))r.rrrÚ__ne__rr0r1rrrr3Ss   zWeakMethod.__ne__)N) Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú __slots__r$r+r/r3rÚ__hash__Ú __classcell__rrr,rr's  rc@sÜeZdZdZd2dd„Zefdd„Zdd„Zd d „Zd d „Z d d„Z dd„Z dd„Z dd„Z e Zdd„Zd3dd„Zdd„Zdd„ZeZdd„Zd d!„Zd"d#„Zd$d%„Zd4d&d'„Zd5d(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„ZdS)6rz›Mapping class that references values weakly. Entries in the dictionary will be discarded when no strong reference to the value exists anymore rcKsBt|ƒtfdd„}||_g|_tƒ|_i|_|j|fi|¤ŽdS)NcSs6|ƒ}|dur2|jr$|j |j¡n||j|jƒdSr))Ú _iteratingÚ_pending_removalsÚappendÚkeyÚdata)ÚwrÚselfrefÚ_atomic_removalrrrrÚremovejs z,WeakValueDictionary.__init__..remove)rr Ú_remover<Úsetr;r?Úupdate)rr2ÚkwrCrrrÚ__init__is  zWeakValueDictionary.__init__cCs>|jj}|j}z |ƒ}Wnty,YdS0|||ƒqdSr))r<Úpopr?Ú IndexError)rrBrIÚdr>rrrÚ_commit_removalszs  z$WeakValueDictionary._commit_removalscCs4|jr| ¡|j|ƒ}|dur,t|ƒ‚n|SdSr)©r<rLr?ÚKeyError©rr>ÚorrrÚ __getitem__†s   zWeakValueDictionary.__getitem__cCs|jr| ¡|j|=dSr))r<rLr?©rr>rrrÚ __delitem__�szWeakValueDictionary.__delitem__cCs|jr| ¡t|jƒSr))r<rLÚlenr?©rrrrÚ_