AlkantarClanX12

Your IP : 18.116.14.48


Current Path : /lib64/python3.8/__pycache__/
Upload File :
Current File : //lib64/python3.8/__pycache__/weakref.cpython-38.opt-2.pyc

U

e5d�S�
@s�ddlmZmZmZmZmZmZmZmZddl	m
Z
mZddlZddl
Z
ddlZeefZdddddd	d
ddd
dddg
ZGdd�de�ZGdd
�d
ej�ZGdd�de�ZGdd�dej�ZGdd�d�ZdS)�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecs@eZdZdZddd�Z�fdd�Zdd�Zd	d
�Zej	Z	�Z
S)r)�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZd+dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
d,dd�Zdd�Zdd�ZeZdd�Zdd �Zd!d"�Zd#d$�Zd-d%d&�Zd.d'd(�Zd)d*�ZdS)/rrcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover9�setr8r<�update)rr/�kwr?rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r9r<�popr	)r�l�dr;rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r9rHr<�KeyError�rr;�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r9rHr<�rr;rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r9rH�lenr<�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrIrKrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrQrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r9rH�KeyedRefr@r<�rr;�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r9rHrrr<�items)r�newr;r=rLrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r^r`r9rHr+rr<r\)r�memor`r]r;r=rLrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rI)rr;�defaultr=rLrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r9rHrr<r\)r�kr=�vrrrr\�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr're)rrfr=rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdSr'�r9rHrr<�valuesrQrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'ri�rr=r%rrrrj�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r9rHr<�popitem)rr;r=rLrrrrm�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r9rHr<rErJ)rr;�argsrLrrrrEs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r<rJr9rHrXr@)rr;rcrLrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr\)r9rHr<�hasattr�dictr\rXr@)rr/�kwargsrGr;rLrrrrBs
zWeakValueDictionary.updatecCs|jr|��t|j���Sr')r9rH�listr<rjrQrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4rDrHrMrOrRrSrWr[r^�__copy__rbrdr\rh�__iter__rkrjrmrErorBrurrrrrZs,
			
			

cs(eZdZdZdd�Z�fdd�Z�ZS)rX�r;cCst�|||�}||_|Sr')rr#r;)r"�obrr;rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rD)rryrr;r*rrrDHszKeyedRef.__init__)r2r3r4r5r#rDr7rrr*rrX7s
rXc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
d+dd�Zdd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd,d&d'�Zd-d(d)�ZdS).rNcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r8r9r:r<)rfr>rrrrr?Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r<rr@r9rAr8�
_dirty_lenrB)rrrr?rrrrDWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r9r<rErJ)rrFrGrrrrHhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rf�rGrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r<r9rzrQrr|r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)rzr<rrNrrrrOzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r<rrNrrrrM~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')rzr9r~rPr<rQrrrrR�szWeakKeyDictionary.__len__cCsd|jjt|�fSrTrUrQrrrrW�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r<rr@rYrrrr[�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr<r\)rr]r;rZrLrrrr^�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr_)r^r`r+rr<r\)rrar`r]r;rZrLrrrrb�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r<rdr�rr;rcrrrrd�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r<)rr;r=rrrrS�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr<r\)rr=rZr;rrrr\�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr<rlrrrrh�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr=rZrrrrj�s

zWeakKeyDictionary.valuescCs
t|j�Sr')rtr<rQrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)rzr<rm)rr;rZrLrrrrm�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)rzr<rEr)rr;rnrrrrE�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r<rorr@rrrrro�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrp)r<rqr"r\rr@rPrB)rrrrsrGr;rZrrrrB�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4rDrHr~rOrMrRrWr[r^rvrbrdrSr\rhrwrjr�rmrErorBrrrrrLs,

	


c@s�eZdZdZiZdZe��ZdZ	dZ
Gdd�d�Zdd�Zde_
dd	d
�Zdd�Zd
d�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��ZdS)rrFc@seZdZdZdS)zfinalize._Info)�weakrefr&rnrs�atexit�indexN)r2r3r4r5rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rPr rE�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rnrs�next�_index_iterr��	_registry�_dirty)rnrsrr%r&r�r��inforrrrDsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdSr')r�rE�	_shutdownr&rnrs)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdSr')r�rdr�rEr&rnrs�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdSr')r�rdr�r&rnrsr�rrr�peek@sz
finalize.peekcCs
||jkSr')r�rQrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jSr'�r�rd�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rrZr�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rdr�r"r2rVr�rrrrWYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r{�f�irrrr}esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rxcSsg|]\}}|�qSrrr�rrrr}gs)r�r\�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wq,t
k
r�tjt�
��Yq,Xq,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rE�	Exception�sys�
excepthook�exc_info)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r�r��	itertools�countr�r�r�r�rD�__text_signature__r)r�r��propertyr�r��setterrW�classmethodr�r�rrrrr�s.*



	
)�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrXrrrrrr�<module>s.(
�6^