Your IP : 3.142.135.24


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/_weakrefset.cpython-35.opt-2.pyc



���]I�@sCddlmZdgZGdd�d�ZGdd�d�ZdS)�)�ref�WeakSetc@s4eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS)N)r�
weakcontainer)�selfr�r�0/opt/alt/python35/lib64/python3.5/_weakrefset.py�__init__sz_IterationGuard.__init__cCs,|j�}|dk	r(|jj|�|S)N)r�
_iterating�add)r�wrrr�	__enter__sz_IterationGuard.__enter__cCsB|j�}|dk	r>|j}|j|�|s>|j�dS)N)rr
�remove�_commit_removals)r�e�t�br�srrr�__exit__s	
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__r	r
rrrrrr
src@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&dS)>rNcCs\t�|_t|�dd�}||_g|_t�|_|dk	rX|j|�dS)NcSsE|�}|dk	rA|jr1|jj|�n|jj|�dS)N)r
�_pending_removals�append�data�discard)�item�selfrefrrrr�_remove&s
		z!WeakSet.__init__.<locals>._remove)�setrrrrr
�update)rrrrrrr	$s		zWeakSet.__init__cCs6|j}|jj}x|r1||j��qWdS)N)rrr�pop)r�lrrrrr4s		zWeakSet._commit_removalsc
csFt|��3x+|jD] }|�}|dk	r|VqWWdQRXdS)N)rr)r�itemrefrrrr�__iter__:s

	zWeakSet.__iter__cCst|j�t|j�S)N)�lenrr)rrrr�__len__CszWeakSet.__len__cCs6yt|�}Wntk
r(dSYnX||jkS)NF)r�	TypeErrorr)rr�wrrrr�__contains__Fs

	zWeakSet.__contains__cCs%|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattr)rrrr�
__reduce__MszWeakSet.__reduce__cCs3|jr|j�|jjt||j��dS)N)rrrrrr)rrrrrrQs	
zWeakSet.addcCs$|jr|j�|jj�dS)N)rrr�clear)rrrrr/Vs	
z
WeakSet.clearcCs
|j|�S)N)r+)rrrr�copy[szWeakSet.copycCsk|jr|j�xQy|jj�}Wntk
rItd��YnX|�}|dk	r|SqWdS)Nzpop from empty WeakSet)rrrr!�KeyError)rr#rrrrr!^s	

	zWeakSet.popcCs-|jr|j�|jjt|��dS)N)rrrrr)rrrrrrjs	
zWeakSet.removecCs-|jr|j�|jjt|��dS)N)rrrrr)rrrrrros	
zWeakSet.discardcCs5|jr|j�x|D]}|j|�qWdS)N)rrr)r�other�elementrrrr ts	

zWeakSet.updatecCs|j|�|S)N)r )rr2rrr�__ior__zs
zWeakSet.__ior__cCs|j�}|j|�|S)N)r0�difference_update)rr2�newsetrrr�
difference~s
zWeakSet.differencecCs|j|�dS)N)�__isub__)rr2rrrr5�szWeakSet.difference_updatecCsP|jr|j�||kr/|jj�n|jjdd�|D��|S)Ncss|]}t|�VqdS)N)r)�.0rrrr�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr/r5)rr2rrrr8�s	
zWeakSet.__isub__cs �j�fdd�|D��S)Nc3s!|]}|�kr|VqdS)Nr)r9r)rrrr:�sz'WeakSet.intersection.<locals>.<genexpr>)r+)rr2r)rr�intersection�szWeakSet.intersectioncCs|j|�dS)N)�__iand__)rr2rrr�intersection_update�szWeakSet.intersection_updatecCs4|jr|j�|jjdd�|D��|S)Ncss|]}t|�VqdS)N)r)r9rrrrr:�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrr=)rr2rrrr<�s	
zWeakSet.__iand__cCs|jjdd�|D��S)Ncss|]}t|�VqdS)N)r)r9rrrrr:�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubset)rr2rrrr>�szWeakSet.issubsetcCs |jtdd�|D��kS)Ncss|]}t|�VqdS)N)r)r9rrrrr:�sz!WeakSet.__lt__.<locals>.<genexpr>)rr)rr2rrr�__lt__�szWeakSet.__lt__cCs|jjdd�|D��S)Ncss|]}t|�VqdS)N)r)r9rrrrr:�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issuperset)rr2rrrr@�szWeakSet.issupersetcCs |jtdd�|D��kS)Ncss|]}t|�VqdS)N)r)r9rrrrr:�sz!WeakSet.__gt__.<locals>.<genexpr>)rr)rr2rrr�__gt__�szWeakSet.__gt__cCs6t||j�stS|jtdd�|D��kS)Ncss|]}t|�VqdS)N)r)r9rrrrr:�sz!WeakSet.__eq__.<locals>.<genexpr>)�
isinstancer+�NotImplementedrr)rr2rrr�__eq__�szWeakSet.__eq__cCs|j�}|j|�|S)N)r0�symmetric_difference_update)rr2r6rrr�symmetric_difference�s
zWeakSet.symmetric_differencecCs|j|�dS)N)�__ixor__)rr2rrrrE�sz#WeakSet.symmetric_difference_updatecsV�jr�j��|kr/�jj�n#�jj�fdd�|D���S)Nc3s!|]}t|�j�VqdS)N)rr)r9r)rrrr:�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr/rE)rr2r)rrrG�s	
#zWeakSet.__ixor__cCs |jdd�||fD��S)Ncss"|]}|D]}|Vq
qdS)Nr)r9rrrrrr:�sz WeakSet.union.<locals>.<genexpr>)r+)rr2rrr�union�sz
WeakSet.unioncCst|j|��dkS)Nr)r%r;)rr2rrr�
isdisjoint�szWeakSet.isdisjoint)'rrrr	rr$r&r)r.rr/r0r!rrr r4r7�__sub__r5r8r;�__and__r=r<r>�__le__r?r@�__ge__rArDrF�__xor__rErGrH�__or__rIrrrrr#sH			N)�_weakrefr�__all__rrrrrr�<module>s	

?>