HEX
Server: LiteSpeed
System: Linux srv146.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: kodi1989 (1633)
PHP: 8.1.34
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/dns/__pycache__/set.cpython-37.pyc
B

��f�#�@sddlZGdd�d�ZdS)�Nc@sNeZdZdZdgZdQdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dS)R�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.
    �itemsNcCs,t�|_|dk	r(x|D]}|�|�qWdS)zaInitialize the set.

        *items*, an iterable or ``None``, the initial set of items.
        N)�dictr�add)�selfr�item�r�8/opt/alt/python37/lib/python3.7/site-packages/dns/set.py�__init__!s
zSet.__init__cCsdtt|j����S)Nzdns.set.Set(%s))�repr�listr�keys)rrrr	�__repr__.szSet.__repr__cCs||jkrd|j|<dS)zAdd an item to the set.N)r)rrrrr	r1s
zSet.addcCs*y|j|=Wntk
r$t�YnXdS)zRemove an item from the set.N)r�KeyError�
ValueError)rrrrr	�remove7sz
Set.removecCs|j�|d�dS)z'Remove an item from the set if present.N)r�pop)rrrrr	�discard?szSet.discardcCs|j��\}}|S)z&Remove an arbitrary item from the set.)r�popitem)r�k�_rrr	rDszSet.pop)�returncCs<t|d�r|j}n|j}|�|�}t�|_|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�objrrr	�_cloneIs

z
Set._clonecCs|��S)z!Make a (shallow) copy of the set.)r)rrrr	�__copy___szSet.__copy__cCs|��S)z!Make a (shallow) copy of the set.)r)rrrr	�copydszSet.copycCs<t|t�std��||krdSx|jD]}|�|�q&WdS)zaUpdate the set, adding any elements from other which are not
        already in the set.
        zother must be a Set instanceN)�
isinstancerrrr)r�otherrrrr	�union_updateis
zSet.union_updatecCsHt|t�std��||krdSx$t|j�D]}||jkr*|j|=q*WdS)z]Update the set, removing any elements from other which are not
        in both sets.
        zother must be a Set instanceN)r"rrrr)rr#rrrr	�intersection_updateus

zSet.intersection_updatecCsDt|t�std��||kr&|j��nx|jD]}|�|�q.WdS)zWUpdate the set, removing any elements from other which are in
        the set.
        zother must be a Set instanceN)r"rrr�clearr)rr#rrrr	�difference_update�s
zSet.difference_updatecCsHt|t�std��||kr&|j��n|�|�}|�|�|�|�dS)z<Update the set, retaining only elements unique to both sets.zother must be a Set instanceN)r"rrrr&�intersectionr$r')rr#�overlaprrr	�symmetric_difference_update�s


zSet.symmetric_difference_updatecCs|��}|�|�|S)zwReturn a new set which is the union of ``self`` and ``other``.

        Returns the same Set type as this set.
        )rr$)rr#rrrr	�union�s
z	Set.unioncCs|��}|�|�|S)z�Return a new set which is the intersection of ``self`` and
        ``other``.

        Returns the same Set type as this set.
        )rr%)rr#rrrr	r(�s
zSet.intersectioncCs|��}|�|�|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.
        )rr')rr#rrrr	�
difference�s
zSet.differencecCs|��}|�|�|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.
        )rr*)rr#rrrr	�symmetric_difference�s
zSet.symmetric_differencecCs
|�|�S)N)r+)rr#rrr	�__or__�sz
Set.__or__cCs
|�|�S)N)r()rr#rrr	�__and__�szSet.__and__cCs
|�|�S)N)r+)rr#rrr	�__add__�szSet.__add__cCs
|�|�S)N)r,)rr#rrr	�__sub__�szSet.__sub__cCs
|�|�S)N)r-)rr#rrr	�__xor__�szSet.__xor__cCs|�|�|S)N)r$)rr#rrr	�__ior__�s
zSet.__ior__cCs|�|�|S)N)r%)rr#rrr	�__iand__�s
zSet.__iand__cCs|�|�|S)N)r$)rr#rrr	�__iadd__�s
zSet.__iadd__cCs|�|�|S)N)r')rr#rrr	�__isub__�s
zSet.__isub__cCs|�|�|S)N)r*)rr#rrr	�__ixor__�s
zSet.__ixor__cCsx|D]}|�|�qWdS)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)r)rr#rrrr	r�s
z
Set.updatecCs|j��dS)zMake the set empty.N)rr&)rrrr	r&�sz	Set.clearcCs|j|jkS)N)r)rr#rrr	�__eq__�sz
Set.__eq__cCs|�|�S)N)r8)rr#rrr	�__ne__�sz
Set.__ne__cCs
t|j�S)N)�lenr)rrrr	�__len__szSet.__len__cCs
t|j�S)N)�iterr)rrrr	�__iter__szSet.__iter__cCsBt|t�r&tt�|j|j|j|j��St	t�|j||d��SdS)N�)
r"�slicer�	itertools�islicer�start�stop�step�next)r�irrr	�__getitem__s
zSet.__getitem__cCs:t|t�r*x*t||�D]}|j|=qWn|j||=dS)N)r"r?rr)rrF�eltrrr	�__delitem__
s
zSet.__delitem__cCs4t|t�std��x|jD]}||jkrdSqWdS)zFIs this set a subset of *other*?

        Returns a ``bool``.
        zother must be a Set instanceFT)r"rrr)rr#rrrr	�issubsets

zSet.issubsetcCs4t|t�std��x|jD]}||jkrdSqWdS)zHIs this set a superset of *other*?

        Returns a ``bool``.
        zother must be a Set instanceFT)r"rrr)rr#rrrr	�
issuperset!s

zSet.issupersetcCs4t|t�std��x|jD]}||jkrdSqWdS)Nzother must be a Set instanceFT)r"rrr)rr#rrrr	�
isdisjoint.s

zSet.isdisjoint)N)+�__name__�
__module__�__qualname__�__doc__�	__slots__r
rrrrrrr r!r$r%r'r*r+r(r,r-r.r/r0r1r2r3r4r5r6r7rr&r8r9r;r=rGrIrJrKrLrrrr	rsP





r)r@rrrrr	�<module>s