� !A?h��X�ddlmZddlmZdgZGd�d��ZGd�d��ZdS)���ref)� GenericAlias�WeakSetc� �eZdZd�Zd�Zd�ZdS)�_IterationGuardc�.�t|��|_dS�N)r� weakcontainer)�selfr s �8/opt/alt/python-internal/lib64/python3.11/_weakrefset.py�__init__z_IterationGuard.__init__s�� ��/�/�����c�f�|���}|�|j�|��|Sr )r � _iterating�add)r �ws r � __enter__z_IterationGuard.__enter__s3�� � � � � �� �=� �L� � �T� "� "� "�� rc��|���}|�4|j}|�|��|s|���dSdSdSr )r r�remove�_commit_removals)r �e�t�br�ss r �__exit__z_IterationGuard.__exit__s_�� � � � � �� �=�� �A� �H�H�T�N�N�N�� %��"�"�$�$�$�$�$� �=� %� %rN)�__name__� __module__� __qualname__rrr�rr rr sA������ 0�0�0���� %�%�%�%�%rrc���eZdZd!d�Zd�Zd�Zd�Zd�Zd�Zd�Z d �Z d �Z d �Z d �Z d �Zd�Zd�Zd�ZeZd�Zd�Zd�ZeZd�Zd�Zd�ZeZd�Zd�ZeZd�Zd�Zd�Z e Z!d�Z"d�Z#d�Z$e$Z%d�Z&d �Z'e(e)��Z*dS)"rNc���t��|_t|��fd�}||_g|_t��|_|�|�|��dSdS)Nc��|��}|�?|jr|j�|��dS|j�|��dSdSr )r�_pending_removals�append�data�discard)�item�selfrefr s r �_removez!WeakSet.__init__.._remove's^���7�9�9�D����?�,��*�1�1�$�7�7�7�7�7��I�%�%�d�+�+�+�+�+�  �r)�setr&rr*r$r�update)r r&r*s r rzWeakSet.__init__%sl���E�E�� �"%�d�)�)� ,� ,� ,� ,��� �!#����%�%��� � � �K�K�� � � � � � � rc��|jj}|jj} |��}n#t$rYdSwxYw||���)r )r$�popr&r'� IndexError)r r.r'r(s r rzWeakSet._commit_removals5sb���$�(���)�#�� � ��s�u�u����� � � ���� ���� �G�D�M�M�M�  s � &� 4�4c#�K�t|��5|jD]}|��}|�|V�� ddd��dS#1swxYwYdSr )rr&�r �itemrefr(s r �__iter__zWeakSet.__iter__?s����� �T� "� "� � ��9� � ���w�y�y���#��J�J�J��  � � � � � � � � � � � � ���� � � � � � s �;�?�?c�T�t|j��t|j��z Sr )�lenr&r$�r s r �__len__zWeakSet.__len__Hs ���4�9�~�~��D�$:� ;� ;�;�;rc�X� t|��}n#t$rYdSwxYw||jvS)NF)r� TypeErrorr&)r r(�wrs r � __contains__zWeakSet.__contains__KsB�� ��T���B�B��� � � ��5�5� �����T�Y��s �� � c�V�|jt|��f|���fSr )� __class__�list� __getstate__r6s r � __reduce__zWeakSet.__reduce__Rs%���~��T� � �}�d�.?�.?�.A�.A�A�Arc��|jr|���|j�t ||j����dSr )r$rr&rrr*�r r(s r rz WeakSet.addUsE�� � !� $� � !� !� #� #� #� � � � �c�$�� �-�-�.�.�.�.�.rc�n�|jr|���|j���dSr )r$rr&�clearr6s r rDz WeakSet.clearZs7�� � !� $� � !� !� #� #� #� � �������rc�,�|�|��Sr �r=r6s r �copyz WeakSet.copy_s���~�~�d�#�#�#rc���|jr|��� |j���}n#t$rt d��d�wxYw|��}|�|S�H)NTzpop from empty WeakSet)r$rr&r.�KeyErrorr1s r r.z WeakSet.popbs��� � !� $� � !� !� #� #� #� � C��)�-�-�/�/����� C� C� C��7�8�8�d�B� C�����7�9�9�D���� � s �8�Ac��|jr|���|j�t |����dSr )r$rr&rrrBs r rzWeakSet.removensA�� � !� $� � !� !� #� #� #� � ����T���#�#�#�#�#rc��|jr|���|j�t |����dSr )r$rr&r'rrBs r r'zWeakSet.discardssA�� � !� $� � !� !� #� #� #� � ���#�d�)�)�$�$�$�$�$rc�p�|jr|���|D]}|�|���dSr )r$rr)r �other�elements r r,zWeakSet.updatexsM�� � !� $� � !� !� #� #� #�� � �G� �H�H�W� � � � � � rc�0�|�|��|Sr )r,�r rMs r �__ior__zWeakSet.__ior__~s�� � � �E����� rc�X�|���}|�|��|Sr )rG�difference_update�r rM�newsets r � differencezWeakSet.difference�s(��������� � ��'�'�'�� rc�0�|�|��dSr )�__isub__rPs r rSzWeakSet.difference_update���� � � �e�����rc���|jr|���||ur|j���n$|j�d�|D����|S)Nc3�4K�|]}t|��V��dSr r��.0r(s r � z#WeakSet.__isub__..�s(����'D�'D�d��D� � �'D�'D�'D�'D�'D�'Dr)r$rr&rDrSrPs r rXzWeakSet.__isub__�sg�� � !� $� � !� !� #� #� #� �5�=�=� �I�O�O� � � � � �I� '� '�'D�'D�e�'D�'D�'D� D� D� D�� rc�F�����fd�|D����S)Nc3�$�K�|] }|�v�|V�� dSr r �r]r(r s �r r^z'WeakSet.intersection..�s'�����E�E�t��� � �d� � � � �E�ErrFrPs` r � intersectionzWeakSet.intersection�s*����~�~�E�E�E�E�u�E�E�E�E�E�Erc�0�|�|��dSr )�__iand__rPs r �intersection_updatezWeakSet.intersection_update�rYrc��|jr|���|j�d�|D����|S)Nc3�4K�|]}t|��V��dSr rr\s r r^z#WeakSet.__iand__..�s(����%B�%B�D�c�$�i�i�%B�%B�%B�%B�%B�%Br)r$rr&rerPs r rdzWeakSet.__iand__�sI�� � !� $� � !� !� #� #� #� � �%�%�%B�%B�E�%B�%B�%B�B�B�B�� rc�J�|j�d�|D����S)Nc3�4K�|]}t|��V��dSr rr\s r r^z#WeakSet.issubset..�s(����!>�!>��#�d�)�)�!>�!>�!>�!>�!>�!>r)r&�issubsetrPs r rjzWeakSet.issubset�s'���y�!�!�!>�!>��!>�!>�!>�>�>�>rc�X�|jttt|����kSr �r&r+�maprrPs r �__lt__zWeakSet.__lt__�����y�3�s�3����/�/�/�/rc�J�|j�d�|D����S)Nc3�4K�|]}t|��V��dSr rr\s r r^z%WeakSet.issuperset..�s(����#@�#@�$�C��I�I�#@�#@�#@�#@�#@�#@r)r&� issupersetrPs r rrzWeakSet.issuperset�s'���y�#�#�#@�#@�%�#@�#@�#@�@�@�@rc�X�|jttt|����kSr rlrPs r �__gt__zWeakSet.__gt__�rorc��t||j��stS|jt t t |����kSr )� isinstancer=�NotImplementedr&r+rmrrPs r �__eq__zWeakSet.__eq__�s9���%���0�0� "�!� !��y�C��C����0�0�0�0rc�X�|���}|�|��|Sr )rG�symmetric_difference_updaterTs r �symmetric_differencezWeakSet.symmetric_difference�s(���������*�*�5�1�1�1�� rc�0�|�|��dSr )�__ixor__rPs r rzz#WeakSet.symmetric_difference_update�rYrc�����jr�����|ur�j���n&�j��fd�|D�����S)Nc3�B�K�|]}t|�j��V��dSr )rr*ras �r r^z#WeakSet.__ixor__..�s/�����1\�1\�d�#�d�D�L�2I�2I�1\�1\�1\�1\�1\�1\r)r$rr&rDrzrPs` r r}zWeakSet.__ixor__�so��� � !� $� � !� !� #� #� #� �5�=�=� �I�O�O� � � � � �I� 1� 1�1\�1\�1\�1\�V[�1\�1\�1\� \� \� \�� rc�D�|�d�||fD����S)Nc3�$K�|] }|D]}|V��� dSr r )r]rrs r r^z WeakSet.union..�s/����B�B�A��B�B�1�a�B�B�B�B�B�B�BrrFrPs r �unionz WeakSet.union�s'���~�~�B�B�$���B�B�B�B�B�Brc�N�t|�|����dkS)Nr)r5rbrPs r � isdisjointzWeakSet.isdisjoint�s#���4�$�$�U�+�+�,�,��1�1rc�*�t|j��Sr )�reprr&r6s r �__repr__zWeakSet.__repr__�s���D�I���rr )+rrrrrr3r7r;r@rrDrGr.rr'r,rQrV�__sub__rSrXrb�__and__rerdrj�__le__rnrr�__ge__rtrxr{�__xor__rzr}r��__or__r�r�� classmethodr�__class_getitem__r rr rr$s&���������� ������<�<�<����B�B�B�/�/�/� ��� $�$�$� � � �$�$�$� %�%�%� ��� �������G�������F�F�F��G������� ?�?�?� �F�0�0�0�A�A�A� �F�0�0�0�1�1�1� ���#�G�������C�C�C� �F�2�2�2����$� �L�1�1���rN)�_weakrefr�typesr�__all__rrr rr �r�s��� ������������ �+��%�%�%�%�%�%�%�%�2i2�i2�i2�i2�i2�i2�i2�i2�i2�i2r