%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dns/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dns/__pycache__/set.cpython-312.pyc

�

5��e�#�� �ddlZGd�d�Zy)�Nc��eZdZdZdgZd*d�Zd�Zd�Zd�Zd�Z	d	�Z
d+d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d �Z!d!�Z"d"�Z#d#�Z$d$�Z%d%�Z&d&�Z'd'�Z(d(�Z)d)�Z*y),�Seta!A simple set class.

    This class was originally used to deal with sets being missing in
    ancient versions of python, but dnspython will continue to use it
    as these sets are based on lists and are thus indexable, and this
    ability is widely used in dnspython applications.
    �itemsNc�X�t�|_|�|D]}|j|��yy)zaInitialize the set.

        *items*, an iterable or ``None``, the initial set of items.
        N)�dictr�add)�selfr�items   �)/usr/lib/python3/dist-packages/dns/set.py�__init__zSet.__init__ s4���V��
����
�������
��c�`�dtt|jj���zS)Nzdns.set.Set(%s))�repr�listr�keys�r	s r�__repr__zSet.__repr__-s"�� �4��T�Z�Z�_�_�->�(?�#@�@�@r
c�@�||jvrd|j|<yy)zAdd an item to the set.N�r�r	r
s  rrzSet.add0s#���t�z�z�!�#�D�J�J�t��"r
c�F�	|j|=y#t$rt�wxYw)zRemove an item from the set.N)r�KeyError�
ValueErrorrs  r�removez
Set.remove6s(��	��
�
�4� ���	���	�s�
� c�<�|jj|d�y)z'Remove an item from the set if present.N)r�poprs  r�discardzSet.discard>s��	
�
�
���t�T�"r
c�@�|jj�\}}|S)z&Remove an arbitrary item from the set.)r�popitem)r	�k�_s   rrzSet.popCs�����#�#�%���A��r
c���t|d�r
|j}n|j}|j|�}t	�|_|j
j
|j
�|S)a�Make a (shallow) copy of the set.

        There is a 'clone protocol' that subclasses of this class
        should use.  To make a copy, first call your super's _clone()
        method, and use the object returned as the new instance.  Then
        make shallow copies of the attributes defined in the subclass.

        This protocol allows us to write the set algorithms that
        return new instances (e.g. union) once, and keep using them in
        subclasses.
        �_clone_class)�hasattrr#�	__class__�__new__rr�update)r	�cls�objs   r�_clonez
Set._cloneHsT���4��(��#�#�C��.�.�C��k�k�#����F��	��	�	������$��
r
c�"�|j�S�z!Make a (shallow) copy of the set.�r*rs r�__copy__zSet.__copy__^����{�{�}�r
c�"�|j�Sr,r-rs r�copyzSet.copycr/r
c��t|t�std��||ury|jD]}|j	|��y)zaUpdate the set, adding any elements from other which are not
        already in the set.
        �other must be a Set instanceN)�
isinstancerrrr�r	�otherr
s   r�union_updatezSet.union_updatehsB��
�%��%��;�<�<��5�=���K�K�	�D��H�H�T�N�	r
c��t|t�std��||uryt|j�D]}||jvs�|j|=� y)z]Update the set, removing any elements from other which are not
        in both sets.
        r3N)r4rrrrr5s   r�intersection_updatezSet.intersection_updatetsV��
�%��%��;�<�<��5�=������$�	%�D��5�;�;�&��J�J�t�$�	%r
c��t|t�std��||ur|jj	�y|jD]}|j|��y)zWUpdate the set, removing any elements from other which are in
        the set.
        r3N)r4rrr�clearrr5s   r�difference_updatezSet.difference_update�sP��
�%��%��;�<�<��5�=��J�J�������
#�����T�"�
#r
c���t|t�std��||ur|jj	�y|j|�}|j
|�|j|�y)z<Update the set, retaining only elements unique to both sets.r3N)r4rrrr;�intersectionr7r<)r	r6�overlaps   r�symmetric_difference_updatezSet.symmetric_difference_update�s]���%��%��;�<�<��5�=��J�J�����'�'��.�G����e�$��"�"�7�+r
c�H�|j�}|j|�|S)zwReturn a new set which is the union of ``self`` and ``other``.

        Returns the same Set type as this set.
        )r*r7�r	r6r)s   r�unionz	Set.union�s"���k�k�m��������
r
c�H�|j�}|j|�|S)z�Return a new set which is the intersection of ``self`` and
        ``other``.

        Returns the same Set type as this set.
        )r*r9rBs   rr>zSet.intersection�s"���k�k�m������&��
r
c�H�|j�}|j|�|S)z�Return a new set which ``self`` - ``other``, i.e. the items
        in ``self`` which are not also in ``other``.

        Returns the same Set type as this set.
        )r*r<rBs   r�
differencezSet.difference�s"���k�k�m�����e�$��
r
c�H�|j�}|j|�|S)z�Return a new set which (``self`` - ``other``) | (``other``
        - ``self), ie: the items in either ``self`` or ``other`` which
        are not contained in their intersection.

        Returns the same Set type as this set.
        )r*r@rBs   r�symmetric_differencezSet.symmetric_difference�s"���k�k�m���'�'��.��
r
c�$�|j|�S�N�rC�r	r6s  r�__or__z
Set.__or__�����z�z�%� � r
c�$�|j|�SrJ)r>rLs  r�__and__zSet.__and__�s��� � ��'�'r
c�$�|j|�SrJrKrLs  r�__add__zSet.__add__�rNr
c�$�|j|�SrJ)rFrLs  r�__sub__zSet.__sub__�s�����u�%�%r
c�$�|j|�SrJ)rHrLs  r�__xor__zSet.__xor__�s���(�(��/�/r
c�(�|j|�|SrJ�r7rLs  r�__ior__zSet.__ior__�������%� ��r
c�(�|j|�|SrJ)r9rLs  r�__iand__zSet.__iand__�s��� � ��'��r
c�(�|j|�|SrJrXrLs  r�__iadd__zSet.__iadd__�rZr
c�(�|j|�|SrJ)r<rLs  r�__isub__zSet.__isub__�s�����u�%��r
c�(�|j|�|SrJ)r@rLs  r�__ixor__zSet.__ixor__�s���(�(��/��r
c�4�|D]}|j|��y)z�Update the set, adding any elements from other which are not
        already in the set.

        *other*, the collection of items with which to update the set, which
        may be any iterable type.
        N)rr5s   rr'z
Set.update�s���	�D��H�H�T�N�	r
c�8�|jj�y)zMake the set empty.N)rr;rs rr;z	Set.clear�s���
�
���r
c�4�|j|jk(SrJrrLs  r�__eq__z
Set.__eq__�s���z�z�U�[�[�(�(r
c�&�|j|�SrJ)rfrLs  r�__ne__z
Set.__ne__�s���;�;�u�%�%�%r
c�,�t|j�SrJ)�lenrrs r�__len__zSet.__len__s���4�:�:��r
c�,�t|j�SrJ)�iterrrs r�__iter__zSet.__iter__s���D�J�J��r
c��t|t�rIttj|j
|j|j|j��Sttj|j
||dz��S)N�)
r4�slicer�	itertools�islicer�start�stop�step�next)r	�is  r�__getitem__zSet.__getitem__sZ���a����	�(�(����Q�W�W�a�f�f�a�f�f�M�N�N��	�(�(����Q��A��>�?�?r
c��t|t�r!t||�D]}|j|=�y|j||=yrJ)r4rqrr)r	rx�elts   r�__delitem__zSet.__delitem__s@���a����D��G�}�
$���J�J�s�O�
$��
�
�4��7�#r
c�|�t|t�std��|jD]}||jvs�yy)zFIs this set a subset of *other*?

        Returns a ``bool``.
        r3FT�r4rrrr5s   r�issubsetzSet.issubsetsA���%��%��;�<�<��J�J�	�D��5�;�;�&��	�r
c�|�t|t�std��|jD]}||jvs�yy)zHIs this set a superset of *other*?

        Returns a ``bool``.
        r3FTr~r5s   r�
issupersetzSet.issuperset sA���%��%��;�<�<��K�K�	�D��4�:�:�%��	�r
c�|�t|t�std��|jD]}||jvs�yy)Nr3FTr~r5s   r�
isdisjointzSet.isdisjoint-s?���%��%��;�<�<��K�K�	�D��t�z�z�!��	�r
rJ)�returnr)+�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrr*r.r1r7r9r<r@rCr>rFrHrMrPrRrTrVrYr\r^r`rbr'r;rfrhrkrnryr|rr�r��r
rrrs�����	�I��A�$��#�
�
�,�
�

�
%�#�
,��	�	�
�!�(�!�&�0������	��)�&�� �@�$���r
r)rrrr�r
r�<module>r�s��$�^�^r

Zerion Mini Shell 1.0