o
    éT•j~  ã                   @   s”  d Z ddlmZmZ ddlZeee ƒZedƒZ	dd„ Z
ee
ƒZ[
g d¢ZdZeed	ƒƒZeeeƒ ƒƒZeei  ¡ ƒƒZeei  ¡ ƒƒZeei  ¡ ƒƒZeeg ƒƒZeeeg ƒƒƒZeeedƒƒƒZeeed
d> ƒƒƒZeeeƒ ƒƒZeedƒƒZ eedƒƒZ!eee"ƒ ƒƒZ#ei  ¡ ƒZ$ei  ¡ ƒZ%ei  ¡ ƒZ&eej'ƒZ(edd„ ƒ ƒZ)dd„ Z*e*ƒ Z*ee*ƒZ+e* ,¡  [*dd„ Z-e-ƒ Z-ee-ƒZ.[-dd„ Z/G dd„ ded�Z0G dd„ ded�Z1G dd„ de1ƒZ2e2 3e+¡ G dd„ ded�Z4G dd „ d e4ƒZ5G d!d"„ d"e5ƒZ6e6 3e.¡ G d#d$„ d$ed�Z7G d%d&„ d&e7ƒZ8e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e¡ e8 3e ¡ e8 3e!¡ e8 3e#¡ G d'd(„ d(e7ƒZ9G d)d*„ d*e8ƒZ:e: 3e)¡ G d+d,„ d,ed�Z;G d-d.„ d.ed�Z<G d/d0„ d0e;e7e<ƒZ=G d1d2„ d2eƒZ>d3d4„ Z?d5d6„ Z@d7d8„ ZAG d9d:„ d:ed�ZBG d;d<„ d<e=ƒZCeC 3eD¡ G d=d>„ d>eCƒZEeE 3e¡ G d?d@„ d@e=ƒZFeF 3e(¡ G dAdB„ dBe;ƒZGG dCdD„ dDeGeCƒZHeH 3e$¡ G dEdF„ dFeGeCƒZIeI 3e&¡ G dGdH„ dHeGe=ƒZJeJ 3e%¡ G dIdJ„ dJeFƒZKeK 3eL¡ G dKdL„ dLe9e=ƒZMeM 3eN¡ eM 3eO¡ eM 3e¡ eM 3eP¡ G dMdN„ dNeMƒZQeQ 3eR¡ eQ 3e¡ G dOdP„ dPeMƒZSeS 3e¡ eS 3e¡ dS )QzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
é    )ÚABCMetaÚabstractmethodN.c                   C   s   d S ©N© r   r   r   ú'/usr/lib/python3.10/_collections_abc.pyÚ_f   s    r   )Ú	AwaitableÚ	CoroutineÚAsyncIterableÚAsyncIteratorÚAsyncGeneratorÚHashableÚIterableÚIteratorÚ	GeneratorÚ
ReversibleÚSizedÚ	ContainerÚCallableÚ
CollectionÚSetÚ
MutableSetÚMappingÚMutableMappingÚMappingViewÚKeysViewÚ	ItemsViewÚ
ValuesViewÚSequenceÚMutableSequenceÚ
ByteStringzcollections.abcó    é   iè  Ú r   c                   c   s   � d V S r   r   r   r   r   r   Ú<lambda>>   s   € r$   c                   Ã   s   �d S r   r   r   r   r   r   Ú_coro@   s   € r%   c                   C  s   �d V  d S r   r   r   r   r   r   Ú_agF   s   €
 r&   c                 G   sN   | j }|D ]}|D ]}||jv r|j| d u rt    S  nq	t  S qdS )NT)Ú__mro__Ú__dict__ÚNotImplemented)ÚCÚmethodsÚmroÚmethodÚBr   r   r   Ú_check_methodsN   s   
ýþr/   c                   @   ó(   e Zd ZdZedd„ ƒZedd„ ƒZdS )r   r   c                 C   ó   dS ©Nr   r   ©Úselfr   r   r   Ú__hash__^   ó   zHashable.__hash__c                 C   ó   | t u r	t|dƒS tS )Nr5   )r   r/   r)   ©Úclsr*   r   r   r   Ú__subclasshook__b   ó   
zHashable.__subclasshook__N)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__r   r5   Úclassmethodr:   r   r   r   r   r   Z   ó    
r   )Ú	metaclassc                   @   ó0   e Zd ZdZedd„ ƒZedd„ ƒZeeƒZ	dS )r   r   c                 c   s   � d V  d S r   r   r3   r   r   r   Ú	__await__m   s   €
zAwaitable.__await__c                 C   r7   )NrD   )r   r/   r)   r8   r   r   r   r:   q   r;   zAwaitable.__subclasshook__N)
r<   r=   r>   r?   r   rD   r@   r:   ÚGenericAliasÚ__class_getitem__r   r   r   r   r   i   ó    

r   c                   @   s>   e Zd ZdZedd„ ƒZeddd„ƒZdd„ Zed	d
„ ƒZ	dS )r	   r   c                 C   ó   t ‚)zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        ©ÚStopIteration©r4   Úvaluer   r   r   Úsend~   ó   zCoroutine.sendNc                 C   ó0   |du r|du r
|‚|ƒ }|dur|  |¡}|‚)zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N©Úwith_traceback©r4   ÚtypÚvalÚtbr   r   r   Úthrow…   ó   
zCoroutine.throwc              	   C   ó.   z
|   t¡ W tdƒ‚ ttfy   Y dS w )ú.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN©rV   ÚGeneratorExitrJ   ÚRuntimeErrorr3   r   r   r   Úclose’   ó   ýÿzCoroutine.closec                 C   s   | t u rt|ddddƒS tS )NrD   rM   rV   r]   )r	   r/   r)   r8   r   r   r   r:   œ   s   zCoroutine.__subclasshook__©NN)
r<   r=   r>   r?   r   rM   rV   r]   r@   r:   r   r   r   r   r	   z   s    

r	   c                   @   rC   )r
   r   c                 C   s   t ƒ S r   )r   r3   r   r   r   Ú	__aiter__ª   s   zAsyncIterable.__aiter__c                 C   r7   )Nr`   )r
   r/   r)   r8   r   r   r   r:   ®   r;   zAsyncIterable.__subclasshook__N)
r<   r=   r>   r?   r   r`   r@   r:   rE   rF   r   r   r   r   r
   ¦   rG   r
   c                   @   ó0   e Zd ZdZedd„ ƒZdd„ Zedd„ ƒZdS )	r   r   c                 Ã   ó   �t ‚)z@Return the next item or raise StopAsyncIteration when exhausted.©ÚStopAsyncIterationr3   r   r   r   Ú	__anext__»   s   €zAsyncIterator.__anext__c                 C   ó   | S r   r   r3   r   r   r   r`   À   ó   zAsyncIterator.__aiter__c                 C   ó   | t u r
t|ddƒS tS )Nre   r`   )r   r/   r)   r8   r   r   r   r:   Ã   ó   zAsyncIterator.__subclasshook__N)	r<   r=   r>   r?   r   re   r`   r@   r:   r   r   r   r   r   ·   ó    
r   c                   @   óF   e Zd ZdZdd„ Zedd„ ƒZeddd„ƒZd	d
„ Ze	dd„ ƒZ
dS )r   r   c                 Ã   s   �|   d¡I dH S )zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)Úasendr3   r   r   r   re   Î   s   €zAsyncGenerator.__anext__c                 Ã   rb   )zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        rc   rK   r   r   r   rl   Ô   s   €zAsyncGenerator.asendNc                 Ã   s2   �|du r|du r|‚|ƒ }|dur|  |¡}|‚)zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrP   rR   r   r   r   ÚathrowÛ   s   €
zAsyncGenerator.athrowc              	   Ã   s6   �z|   t¡I dH  W tdƒ‚ ttfy   Y dS w )rY   Nz,asynchronous generator ignored GeneratorExit)rm   r[   rd   r\   r3   r   r   r   Úacloseè   s   €ýÿzAsyncGenerator.aclosec                 C   ó   | t u rt|dddddƒS tS )Nr`   re   rl   rm   rn   )r   r/   r)   r8   r   r   r   r:   ò   ó
   ÿzAsyncGenerator.__subclasshook__r_   )r<   r=   r>   r?   re   r   rl   rm   rn   r@   r:   r   r   r   r   r   Ê   ó    

r   c                   @   rC   )r   r   c                 c   ó   � d S r   r   r3   r   r   r   Ú__iter__  ó   €zIterable.__iter__c                 C   r7   )Nrs   )r   r/   r)   r8   r   r   r   r:     r;   zIterable.__subclasshook__N)
r<   r=   r>   r?   r   rs   r@   r:   rE   rF   r   r   r   r   r   ý   s    

r   c                   @   ra   )	r   r   c                 C   rH   )zKReturn the next item from the iterator. When exhausted, raise StopIterationrI   r3   r   r   r   Ú__next__  ó   zIterator.__next__c                 C   rf   r   r   r3   r   r   r   rs     rg   zIterator.__iter__c                 C   rh   )Nrs   ru   )r   r/   r)   r8   r   r   r   r:     ri   zIterator.__subclasshook__N)	r<   r=   r>   r?   r   ru   rs   r@   r:   r   r   r   r   r     rj   r   c                   @   r0   )r   r   c                 c   rr   r   r   r3   r   r   r   Ú__reversed__6  rt   zReversible.__reversed__c                 C   rh   )Nrw   rs   )r   r/   r)   r8   r   r   r   r:   ;  ri   zReversible.__subclasshook__N)r<   r=   r>   r?   r   rw   r@   r:   r   r   r   r   r   2  s    
r   c                   @   rk   )r   r   c                 C   s
   |   d¡S )z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)rM   r3   r   r   r   ru   F  s   
zGenerator.__next__c                 C   rH   )zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        rI   rK   r   r   r   rM   L  rN   zGenerator.sendNc                 C   rO   )zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        NrP   rR   r   r   r   rV   S  rW   zGenerator.throwc              	   C   rX   )z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitNrZ   r3   r   r   r   r]   `  r^   zGenerator.closec                 C   ro   )Nrs   ru   rM   rV   r]   )r   r/   r)   r8   r   r   r   r:   j  rp   zGenerator.__subclasshook__r_   )r<   r=   r>   r?   ru   r   rM   rV   r]   r@   r:   r   r   r   r   r   B  rq   r   c                   @   r0   )r   r   c                 C   r1   r2   r   r3   r   r   r   Ú__len__y  r6   zSized.__len__c                 C   r7   )Nrx   )r   r/   r)   r8   r   r   r   r:   }  r;   zSized.__subclasshook__N)r<   r=   r>   r?   r   rx   r@   r:   r   r   r   r   r   u  rA   r   c                   @   rC   )r   r   c                 C   r1   ©NFr   )r4   Úxr   r   r   Ú__contains__ˆ  r6   zContainer.__contains__c                 C   r7   )Nr{   )r   r/   r)   r8   r   r   r   r:   Œ  r;   zContainer.__subclasshook__N)
r<   r=   r>   r?   r   r{   r@   r:   rE   rF   r   r   r   r   r   „  rG   r   c                   @   s   e Zd ZdZedd„ ƒZdS )r   r   c                 C   s   | t u rt|dddƒS tS )Nrx   rs   r{   )r   r/   r)   r8   r   r   r   r:   ™  s   zCollection.__subclasshook__N)r<   r=   r>   r?   r@   r:   r   r   r   r   r   •  s    r   c                       sL   e Zd ZdZdZ‡ fdd„Zedd„ ƒZ‡ fdd„Zd	d
„ Z	dd„ Z
‡  ZS )Ú_CallableGenericAliaszü Represent `Callable[argtypes, resulttype]`.

    This sets ``__args__`` to a tuple containing the flattened ``argtypes``
    followed by ``resulttype``.

    Example: ``Callable[[int, str], float]`` sets ``__args__`` to
    ``(int, str, float)``.
    r   c                    sf   t |tƒrt|ƒdkstdƒ‚|\}}t |tƒr g |¢|‘R }nt|ƒs+td|› �ƒ‚tƒ  | ||¡S )Né   z6Callable must be used as Callable[[arg, ...], result].úFExpected a list of types, an ellipsis, ParamSpec, or Concatenate. Got )Ú
isinstanceÚtupleÚlenÚ	TypeErrorÚlistÚ_is_param_exprÚsuperÚ__new__)r9   ÚoriginÚargsÚt_argsÚt_result©Ú	__class__r   r   r†   ¬  s   ÿ
ÿz_CallableGenericAlias.__new__c                 C   sj   g }| j D ](}t|tƒrt|tƒsqt|dƒr$t|jtƒr$| |j¡ qt|ƒr-| 	|¡ qtt
 |¡ƒS )NÚ__parameters__)Ú__args__r   ÚtyperE   Úhasattrr�   r€   ÚextendÚ_is_typevarlikeÚappendÚdictÚfromkeys)r4   ÚparamsÚargr   r   r   r�   ¸  s   

€z$_CallableGenericAlias.__parameters__c                    s\   t | jƒdkrt| jd ƒrtƒ  ¡ S dd dd„ | jd d… D ƒ¡› dt| jd ƒ› d	�S )
Nr}   r   zcollections.abc.Callable[[z, c                 S   s   g | ]}t |ƒ‘qS r   )Ú
_type_repr)Ú.0Úar   r   r   Ú
<listcomp>Ê  s    z2_CallableGenericAlias.__repr__.<locals>.<listcomp>éÿÿÿÿz], ú])r�   rŽ   r„   r…   Ú__repr__Újoinr˜   r3   r‹   r   r   rž   Æ  s   
ÿþz_CallableGenericAlias.__repr__c                 C   sB   | j }t|ƒdkrt|d ƒst|d d… ƒ|d f}tt|ffS )Nr}   r   rœ   )rŽ   r�   r„   rƒ   r|   r   )r4   rˆ   r   r   r   Ú
__reduce__Í  s   z _CallableGenericAlias.__reduce__c           
   	      s¬  t | jƒ}|dkrt| › d�ƒ‚t|tƒs|f}|dkr0t| jd ƒr0|r0t|d ƒs0t|ƒf}t |ƒ}||krNtd||kr@dnd› d| › d|› d	|› �ƒ‚tt| j|ƒƒ‰ g }| j	D ]^}t|t
ƒrmt|tƒsm| |¡ q[t|ƒrŠt|ƒr…ˆ | }t|ƒs„td
|› �ƒ‚n$ˆ | }nt|dƒr©t|jtƒr©|j}|r©t‡ fdd„|D ƒƒ}|| }t|tƒr´| |¡ q[| |¡ q[t|d tƒsÏ|d }|d d… }	|	|f}ttt|ƒƒS )Nr   z is not a generic classr"   zToo ÚmanyÚfewz arguments for z	; actual z, expected r~   r�   c                 3   s   � | ]}ˆ | V  qd S r   r   )r™   rz   ©Úsubstr   r   Ú	<genexpr>ú  s   € z4_CallableGenericAlias.__getitem__.<locals>.<genexpr>rœ   )r�   r�   r‚   r   r€   r„   rƒ   r”   ÚziprŽ   r�   rE   r“   r’   r�   r‘   r|   r   )
r4   ÚitemÚ	param_lenÚitem_lenÚnew_argsr—   Ú	subparamsÚsubargsrŠ   r‰   r   r£   r   Ú__getitem__Ó  s`   

ÿ
ÿ
ÿþþ

ÿÿ

z!_CallableGenericAlias.__getitem__)r<   r=   r>   Ú__doc__r?   r†   Úpropertyr�   rž   r    r­   Ú__classcell__r   r   r‹   r   r|      s    	
r|   c                 C   s   t | ƒ}|jdko|jdv S )NÚtyping>   ÚTypeVarÚ	ParamSpec)r�   r=   r<   )r—   Úobjr   r   r   r’   	  s   
ÿr’   c                    sF   ˆ t u rdS tˆ tƒrdS tˆ ƒ‰ d}ˆ jdko"t‡ fdd„|D ƒƒS )z|Checks if obj matches either a list of types, ``...``, ``ParamSpec`` or
    ``_ConcatenateGenericAlias`` from typing.py
    T)r³   Ú_ConcatenateGenericAliasr±   c                 3   s   � | ]}ˆ j |kV  qd S r   )r<   )r™   Úname©r´   r   r   r¥     s   € z!_is_param_expr.<locals>.<genexpr>)ÚEllipsisr   rƒ   r�   r=   Úany)r´   Únamesr   r·   r   r„     s   
 r„   c                 C   sb   t | tƒr	t| ƒS t | tƒr| jdkr| jS | j› d| j› �S | tu r%dS t | tƒr-| jS t| ƒS )z¦Return the repr() of an object, special-casing types (internal helper).

    Copied from :mod:`typing` since collections.abc
    shouldn't depend on that module.
    ÚbuiltinsÚ.z...)	r   rE   Úreprr�   r=   r>   r¸   ÚFunctionTyper<   r·   r   r   r   r˜     s   



r˜   c                   @   rC   )r   r   c                 O   r1   ry   r   )r4   rˆ   Úkwdsr   r   r   Ú__call__2  r6   zCallable.__call__c                 C   r7   )NrÀ   )r   r/   r)   r8   r   r   r   r:   6  r;   zCallable.__subclasshook__N)
r<   r=   r>   r?   r   rÀ   r@   r:   r|   rF   r   r   r   r   r   .  rG   r   c                   @   sŒ   e Zd ZdZdZdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Z	e
dd„ ƒZdd„ ZeZdd„ Zdd„ ZeZdd„ Zdd„ Zdd„ ZeZdd„ ZdS )r   aZ  A set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__ and __len__.

    To override the comparisons (presumably for speed, as the
    semantics are fixed), redefine __le__ and __ge__,
    then the other operations will automatically follow suit.
    r   c                 C   s>   t |tƒstS t| ƒt|ƒkrdS | D ]	}||vr dS qdS ©NFT©r   r   r)   r�   ©r4   ÚotherÚelemr   r   r   Ú__le__O  ó   
ÿz
Set.__le__c                 C   s(   t |tƒstS t| ƒt|ƒk o|  |¡S r   ©r   r   r)   r�   rÆ   ©r4   rÄ   r   r   r   Ú__lt__Y  ó   
z
Set.__lt__c                 C   s(   t |tƒstS t| ƒt|ƒko|  |¡S r   )r   r   r)   r�   Ú__ge__rÉ   r   r   r   Ú__gt__^  rË   z
Set.__gt__c                 C   s>   t |tƒstS t| ƒt|ƒk rdS |D ]	}|| vr dS qdS rÁ   rÂ   rÃ   r   r   r   rÌ   c  rÇ   z
Set.__ge__c                 C   s(   t |tƒstS t| ƒt|ƒko|  |¡S r   rÈ   rÉ   r   r   r   Ú__eq__m  rË   z
Set.__eq__c                 C   s   | |ƒS )z¼Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.
        r   ©r9   Úitr   r   r   Ú_from_iterabler  s   zSet._from_iterablec                    s&   t |tƒstS ˆ  ‡ fdd„|D ƒ¡S )Nc                 3   s   � | ]	}|ˆ v r|V  qd S r   r   ©r™   rL   r3   r   r   r¥   ~  s   € zSet.__and__.<locals>.<genexpr>©r   r   r)   rÑ   rÉ   r   r3   r   Ú__and__{  ó   
zSet.__and__c                 C   s   |D ]	}|| v r dS qdS )z1Return True if two sets have a null intersection.FTr   )r4   rÄ   rL   r   r   r   Ú
isdisjoint‚  s
   ÿzSet.isdisjointc                 C   s*   t |tƒstS dd„ | |fD ƒ}|  |¡S )Nc                 s   s   � | ]
}|D ]}|V  qqd S r   r   )r™   ÚsÚer   r   r   r¥   Œ  s   € zSet.__or__.<locals>.<genexpr>rÓ   )r4   rÄ   Úchainr   r   r   Ú__or__‰  s   

z
Set.__or__c                    s:   t ˆ tƒst ˆ tƒstS |  ˆ ¡‰ |  ‡ fdd„| D ƒ¡S )Nc                 3   ó   � | ]	}|ˆ vr|V  qd S r   r   rÒ   ©rÄ   r   r   r¥   –  ó   € ÿÿzSet.__sub__.<locals>.<genexpr>©r   r   r   r)   rÑ   rÉ   r   rÜ   r   Ú__sub__‘  ó
   


zSet.__sub__c                    s:   t |tƒst |tƒstS ˆ  |¡}ˆ  ‡ fdd„|D ƒ¡S )Nc                 3   rÛ   r   r   rÒ   r3   r   r   r¥   ž  rÝ   zSet.__rsub__.<locals>.<genexpr>rÞ   rÉ   r   r3   r   Ú__rsub__™  rà   zSet.__rsub__c                 C   s2   t |tƒst |tƒstS |  |¡}| | ||  B S r   rÞ   rÉ   r   r   r   Ú__xor__¡  s
   


zSet.__xor__c                 C   s¬   t j}d| d }t| ƒ}d|d  }||M }| D ]}t|ƒ}|||d> A dA d N }||M }q||d? |d? A N }|d	 d
 }||M }||krN||d 8 }|dkrTd}|S )a+  Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.
        r}   r"   iMïèré   i³M[l   ×4~2 é   é   iÍ iãÃ6rœ   iÁÇ8#)ÚsysÚmaxsizer�   Úhash)r4   ÚMAXÚMASKÚnÚhrz   Úhxr   r   r   Ú_hashª  s"   
z	Set._hashN)r<   r=   r>   r®   r?   rÆ   rÊ   rÍ   rÌ   rÎ   r@   rÑ   rÔ   Ú__rand__rÖ   rÚ   Ú__ror__rß   rá   râ   Ú__rxor__rî   r   r   r   r   r   B  s(    



r   c                   @   sd   e Zd ZdZdZedd„ ƒZedd„ ƒZdd„ Zd	d
„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )r   a‡  A mutable set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__, __len__,
    add(), and discard().

    To override the comparisons (presumably for speed, as the
    semantics are fixed), all you have to do is redefine __le__ and
    then the other operations will automatically follow suit.
    r   c                 C   rH   )zAdd an element.©ÚNotImplementedErrorrK   r   r   r   ÚaddÝ  rv   zMutableSet.addc                 C   rH   )z8Remove an element.  Do not raise an exception if absent.rò   rK   r   r   r   Údiscardâ  rv   zMutableSet.discardc                 C   s   || vrt |ƒ‚|  |¡ dS )z5Remove an element. If not a member, raise a KeyError.N)ÚKeyErrorrõ   rK   r   r   r   Úremoveç  s   zMutableSet.removec                 C   s8   t | ƒ}zt|ƒ}W n
 ty   td‚w |  |¡ |S )z2Return the popped value.  Raise KeyError if empty.N)ÚiterÚnextrJ   rö   rõ   ©r4   rÐ   rL   r   r   r   Úpopí  s   ÿ
zMutableSet.popc                 C   ó"   z	 |   ¡  q ty   Y dS w )z6This is slow (creates N new iterators!) but effective.TN)rû   rö   r3   r   r   r   Úclear÷  ó   ÿÿzMutableSet.clearc                 C   s   |D ]}|   |¡ q| S r   )rô   rú   r   r   r   Ú__ior__ÿ  s   zMutableSet.__ior__c                 C   s   | | D ]}|   |¡ q| S r   )rõ   rú   r   r   r   Ú__iand__  s   zMutableSet.__iand__c                 C   sT   || u r
|   ¡  | S t|tƒs|  |¡}|D ]}|| v r"|  |¡ q|  |¡ q| S r   )rý   r   r   rÑ   rõ   rô   rú   r   r   r   Ú__ixor__	  s   	
ù
zMutableSet.__ixor__c                 C   s,   || u r
|   ¡  | S |D ]}|  |¡ q| S r   )rý   rõ   rú   r   r   r   Ú__isub__  s   þzMutableSet.__isub__N)r<   r=   r>   r®   r?   r   rô   rõ   r÷   rû   rý   rÿ   r   r  r  r   r   r   r   r   Ï  s    


r   c                   @   sZ   e Zd ZdZdZdZedd„ ƒZddd„Zd	d
„ Z	dd„ Z
dd„ Zdd„ Zdd„ ZdZdS )r   zÆA Mapping is a generic container for associating key/value
    pairs.

    This class provides concrete generic implementations of all
    methods except for __getitem__, __iter__, and __len__.
    r   é@   c                 C   rH   r   ©rö   ©r4   Úkeyr   r   r   r­   1  r6   zMapping.__getitem__Nc                 C   s"   z| | W S  t y   | Y S w )z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.r  ©r4   r  Údefaultr   r   r   Úget5  s
   
ÿzMapping.getc                 C   s$   z| |  W dS  t y   Y dS w rÁ   r  r  r   r   r   r{   <  s   
ýÿzMapping.__contains__c                 C   ó   t | ƒS )z:D.keys() -> a set-like object providing a view on D's keys)r   r3   r   r   r   ÚkeysD  ó   zMapping.keysc                 C   r
  )z<D.items() -> a set-like object providing a view on D's items)r   r3   r   r   r   ÚitemsH  r  zMapping.itemsc                 C   r
  )z6D.values() -> an object providing a view on D's values)r   r3   r   r   r   ÚvaluesL  r  zMapping.valuesc                 C   s&   t |tƒstS t|  ¡ ƒt| ¡ ƒkS r   )r   r   r)   r”   r  rÉ   r   r   r   rÎ   P  rÕ   zMapping.__eq__r   )r<   r=   r>   r®   r?   Ú__abc_tpflags__r   r­   r	  r{   r  r  r  rÎ   rw   r   r   r   r   r   $  s    

r   c                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ ZeeƒZ	dS )	r   ©Ú_mappingc                 C   s
   || _ d S r   r  )r4   Úmappingr   r   r   Ú__init__^  ó   
zMappingView.__init__c                 C   s
   t | jƒS r   )r�   r  r3   r   r   r   rx   a  r  zMappingView.__len__c                 C   s
   d  | ¡S )Nz&{0.__class__.__name__}({0._mapping!r}))Úformatr3   r   r   r   rž   d  r  zMappingView.__repr__N)
r<   r=   r>   r?   r  rx   rž   r@   rE   rF   r   r   r   r   r   Z  s    r   c                   @   ó,   e Zd ZdZedd„ ƒZdd„ Zdd„ ZdS )	r   r   c                 C   ó   t |ƒS r   ©ÚsetrÏ   r   r   r   rÑ   n  r  zKeysView._from_iterablec                 C   s
   || j v S r   r  r  r   r   r   r{   r  r  zKeysView.__contains__c                 c   s   � | j E d H  d S r   r  r3   r   r   r   rs   u  s   €zKeysView.__iter__N©r<   r=   r>   r?   r@   rÑ   r{   rs   r   r   r   r   r   j  s    
r   c                   @   r  )	r   r   c                 C   r  r   r  rÏ   r   r   r   rÑ   €  r  zItemsView._from_iterablec                 C   s<   |\}}z| j | }W n
 ty   Y dS w ||u p||kS ry   )r  rö   )r4   r§   r  rL   Úvr   r   r   r{   „  s   ÿzItemsView.__contains__c                 c   s"   � | j D ]
}|| j | fV  qd S r   r  r  r   r   r   rs   �  s   €
ÿzItemsView.__iter__Nr  r   r   r   r   r   |  s    
	r   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )r   r   c                 C   s0   | j D ]}| j | }||u s||kr dS qdS ©NTFr  )r4   rL   r  r  r   r   r   r{   ™  s   

ÿzValuesView.__contains__c                 c   s   � | j D ]}| j | V  qd S r   r  r  r   r   r   rs      s   €
ÿzValuesView.__iter__N)r<   r=   r>   r?   r{   rs   r   r   r   r   r   •  s    r   c                   @   sb   e Zd ZdZdZedd„ ƒZedd„ ƒZeƒ Z	e	fdd„Z
d	d
„ Zdd„ Zddd„Zddd„ZdS )r   zëA MutableMapping is a generic container for associating
    key/value pairs.

    This class provides concrete generic implementations of all
    methods except for __getitem__, __setitem__, __delitem__,
    __iter__, and __len__.
    r   c                 C   rH   r   r  ©r4   r  rL   r   r   r   Ú__setitem__³  r6   zMutableMapping.__setitem__c                 C   rH   r   r  r  r   r   r   Ú__delitem__·  r6   zMutableMapping.__delitem__c                 C   s:   z| | }W n t y   || ju r‚ | Y S w | |= |S )z©D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
          If key is not found, d is returned if given, otherwise KeyError is raised.
        )rö   Ú_MutableMapping__marker)r4   r  r  rL   r   r   r   rû   ½  s   
ýzMutableMapping.popc                 C   s<   zt t| ƒƒ}W n
 ty   td‚w | | }| |= ||fS )zƒD.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        N)rù   rø   rJ   rö   r  r   r   r   ÚpopitemË  s   ÿzMutableMapping.popitemc                 C   rü   )z,D.clear() -> None.  Remove all items from D.TN)r!  rö   r3   r   r   r   rý   ×  rþ   zMutableMapping.clearc                K   s|   t |tƒr|D ]}|| | |< qnt|dƒr$| ¡ D ]}|| | |< qn|D ]\}}|| |< q&| ¡ D ]\}}|| |< q3dS )aK   D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
            In either case, this is followed by: for k, v in F.items(): D[k] = v
        r  N)r   r   r�   r  r  )r4   rÄ   r¿   r  rL   r   r   r   Úupdateß  s   
ÿ
ÿ

ÿzMutableMapping.updateNc                 C   s(   z| | W S  t y   || |< Y |S w )z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in Dr  r  r   r   r   Ú
setdefaultñ  s   

þzMutableMapping.setdefault)r   r   )r<   r=   r>   r®   r?   r   r  r  Úobjectr   rû   r!  rý   r"  r#  r   r   r   r   r   ¨  s    


r   c                   @   sN   e Zd ZdZdZdZedd„ ƒZdd„ Zdd	„ Z	d
d„ Z
ddd„Zdd„ ZdS )r   zŠAll the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    r   é    c                 C   rH   r   ©Ú
IndexError©r4   Úindexr   r   r   r­     r6   zSequence.__getitem__c                 c   s6   � d}z	 | | }|V  |d7 }q t y   Y d S w )Nr   Tr"   r&  )r4   Úir  r   r   r   rs     s   €ýÿzSequence.__iter__c                 C   s$   | D ]}||u s||kr dS qdS r  r   )r4   rL   r  r   r   r   r{     s
   ÿzSequence.__contains__c                 c   s&   � t tt| ƒƒƒD ]}| | V  q	d S r   )ÚreversedÚranger�   )r4   r*  r   r   r   rw     s   €ÿzSequence.__reversed__r   Nc                 C   s¦   |dur|dk rt t| ƒ| dƒ}|dur|dk r|t| ƒ7 }|}|du s)||k rQz| | }||u s6||kr9|W S W n
 tyD   Y t‚w |d7 }|du s)||k s)t‚)zæS.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        Nr   r"   )Úmaxr�   r'  Ú
ValueError)r4   rL   ÚstartÚstopr*  r  r   r   r   r)  #  s$   ÿýùzSequence.indexc                    s   t ‡ fdd„| D ƒƒS )zBS.count(value) -> integer -- return number of occurrences of valuec                 3   s$   � | ]}|ˆ u s|ˆ krd V  qdS )r"   Nr   )r™   r  ©rL   r   r   r¥   <  s   €" z!Sequence.count.<locals>.<genexpr>)ÚsumrK   r   r1  r   Úcount:  s   zSequence.count)r   N)r<   r=   r>   r®   r?   r  r   r­   rs   r{   rw   r)  r3  r   r   r   r   r   ÿ  s    


r   c                   @   s   e Zd ZdZdZdS )r    zMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    r   N)r<   r=   r>   r®   r?   r   r   r   r   r    D  s    r    c                   @   sr   e Zd ZdZdZedd„ ƒZedd„ ƒZedd„ ƒZd	d
„ Z	dd„ Z
dd„ Zdd„ Zddd„Zdd„ Zdd„ ZdS )r   z®All the operations on a read-write sequence.

    Concrete subclasses must provide __new__ or __init__,
    __getitem__, __setitem__, __delitem__, __len__, and insert().
    r   c                 C   rH   r   r&  ©r4   r)  rL   r   r   r   r  Y  r6   zMutableSequence.__setitem__c                 C   rH   r   r&  r(  r   r   r   r  ]  r6   zMutableSequence.__delitem__c                 C   rH   )z3S.insert(index, value) -- insert value before indexr&  r4  r   r   r   Úinserta  rv   zMutableSequence.insertc                 C   s   |   t| ƒ|¡ dS )z:S.append(value) -- append value to the end of the sequenceN)r5  r�   rK   r   r   r   r“   f  s   zMutableSequence.appendc                 C   rü   )z,S.clear() -> None -- remove all items from STN)rû   r'  r3   r   r   r   rý   j  rþ   zMutableSequence.clearc                 C   sH   t | ƒ}t|d ƒD ]}| || d  | | | |< | || d < q
dS )z!S.reverse() -- reverse *IN PLACE*r}   r"   N)r�   r,  )r4   rë   r*  r   r   r   Úreverser  s   ,ÿzMutableSequence.reversec                 C   s(   || u rt |ƒ}|D ]}|  |¡ q
dS )zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)rƒ   r“   )r4   r  r  r   r   r   r‘   x  s
   ÿzMutableSequence.extendrœ   c                 C   s   | | }| |= |S )z™S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r   )r4   r)  r  r   r   r   rû     s   zMutableSequence.popc                 C   s   | |   |¡= dS )zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r)  rK   r   r   r   r÷   ‡  s   zMutableSequence.removec                 C   s   |   |¡ | S r   )r‘   )r4   r  r   r   r   Ú__iadd__�  s   
zMutableSequence.__iadd__N)rœ   )r<   r=   r>   r®   r?   r   r  r  r5  r“   rý   r6  r‘   rû   r÷   r7  r   r   r   r   r   P  s     



r   )Tr®   Úabcr   r   ræ   r�   rƒ   ÚintrE   ÚEllipsisTyper   r¾   Ú__all__r<   rø   Úbytes_iteratorÚ	bytearrayÚbytearray_iteratorr  Údict_keyiteratorr  Údict_valueiteratorr  Údict_itemiteratorÚlist_iteratorr+  Úlist_reverseiteratorr,  Úrange_iteratorÚlongrange_iteratorr  Úset_iteratorÚstr_iteratorÚtuple_iteratorr¦   Úzip_iteratorÚ	dict_keysÚdict_valuesÚ
dict_itemsr(   ÚmappingproxyÚ	generatorr%   Ú	coroutiner]   r&   Úasync_generatorr/   r   r   r	   Úregisterr
   r   r   r   r   r   r   r   r   r   r|   r’   r„   r˜   r   r   Ú	frozensetr   r   r   r   r   r   r   r”   r   r€   ÚstrÚ
memoryviewr    Úbytesr   r   r   r   r   Ú<module>   sÆ   	

)
0













0i 

P
3



R
?





B