o
0i8T @ s d Z ddlmZmZmZmZmZmZmZm Z ddl
mZmZ ddl
Z
ddlZddlZeefZg dZe
je e
je G dd deZG dd d e
jZG d
d deZG dd
d
e
jZG dd dZdS )z|Weak reference support for Python.
This module is an implementation of PEP 205:
https://www.python.org/dev/peps/pep-0205/
)getweakrefcountgetweakrefsrefproxyCallableProxyType ProxyType
ReferenceType_remove_dead_weakref)WeakSet_IterationGuardN)
r r r r WeakKeyDictionaryr r r
ProxyTypesWeakValueDictionaryr
WeakMethodfinalizec sD e Zd ZdZdZdddZ fddZdd Zd
d Ze j
Z
ZS )
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__Nc sx z|j }|j}W n ty tdt|d w fdd}t| ||}t|||_t||_ d|_
t||S )Nz)argument should be a bound method, not {}c s. }|j rd|_ d ur | d S d S d S NF)r )argselfcallbackZself_wr ./opt/alt/python310/lib64/python3.10/weakref.py_cb6 s zWeakMethod.__new__.