�
c��j T � �2 � d Z ddlmZmZmZmZmZmZmZm Z ddl
mZmZ ddl
Z
ddlZddlZeefZg d�Ze
j$ j' e� G d� de� Z G d� d e
j* � Z G d
� de� Z G d� d
e
j* � Z G d� d� Zy)ztWeak reference support for Python.
This module is an implementation of PEP 205:
https://peps.python.org/pep-0205/
� )�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType� ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardN)
r r r r �WeakKeyDictionaryr r r �
ProxyTypes�WeakValueDictionaryr �
WeakMethod�finalizec �R � � e Zd ZdZdZdd�Z� fd�Zd� Zd� Ze j Z
� xZS )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 �> ��� |j }|j }��fd�}t
j | ||� }t
||� |_ t |� |_ d|_
t
|� �|S # t $ r% t dj t |� � � d �w xY w)Nz)argument should be a bound method, not {}c �R �� �� }|j rd|_ �� �|� y y y �NF)r )�arg�self�callback�self_wrs ��� /usr/lib64/python3.12/weakref.py�_cbzWeakMethod.__new__.