o
    $x`ð  ã                   @   s¸  d Z ddlmZ ddlZddlmZ zddlmZ W n ey'   ddlZY nw ddlmZ zddlm	Z	 ddlm
Z
 dd	lmZ W n ey]   ddl	m	Z	 dd
l
mZ
 dd	lmZ Y nw ddlmZ ddlmZ ddlmZ ddlmZ ejdd… dkZejdd… dkZefdfdd„Zg d¢ZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG d d!„ d!eƒZG d"d#„ d#eƒZ G d$d%„ d%e eeƒZ!G d&d'„ d'ee!ƒZ"G d(d)„ d)e"ƒZ#G d*d+„ d+e"ƒZ$G d,d-„ d-e!ƒZ%G d.d/„ d/e%ƒZ&G d0d1„ d1e!ƒZ'G d2d3„ d3e'ƒZ(G d4d5„ d5e ƒZ)G d6d7„ d7e)e%ƒZ*G d8d9„ d9e)e%ƒZ+G d:d;„ d;e)e!ƒZ,G d<d=„ d=eƒZ-G d>d?„ d?e-ƒZ.G d@dA„ dAeƒZ/G dBdC„ dCe/ƒZ0G dDdE„ dEe0ƒZ1dS )Faó  
Interface definitions paralleling the abstract base classes defined in
:mod:`collections.abc`.

After this module is imported, the standard library types will declare
that they implement the appropriate interface. While most standard
library types will properly implement that interface (that
is, ``verifyObject(ISequence, list()))`` will pass, for example), a few might not:

    - `memoryview` doesn't feature all the defined methods of
      ``ISequence`` such as ``count``; it is still declared to provide
      ``ISequence`` though.

    - `collections.deque.pop` doesn't accept the ``index`` argument of
      `collections.abc.MutableSequence.pop`

    - `range.index` does not accept the ``start`` and ``stop`` arguments.

.. versionadded:: 5.0.0
é    )Úabsolute_importN)ÚABCMeta)Úabc)ÚOrderedDict)ÚUserList)ÚUserDict)Ú
UserString)ÚIterableUserDict)ÚPYTHON2)ÚPYTHON3)ÚABCInterface)Úoptionalé   )é   é   )r   é   © c                 C   s:   |rt t| ƒS t| |dd|  iƒ}|D ]}| |¡ q|S )NÚ__doc__z4The ABC %s is not defined in this version of Python.)Úgetattrr   r   Úregister)ÚnameÚverÚbases_if_missingÚregister_if_missingÚmissingÚcr   r   úC/usr/lib/python3/dist-packages/zope/interface/common/collections.pyÚ_new_in_verJ   s   
ÿÿr   )ÚIAsyncGeneratorÚIAsyncIterableÚIAsyncIteratorÚ
IAwaitableÚICollectionÚ
IContainerÚ
ICoroutineÚ
IGeneratorÚ	IHashableÚ
IItemsViewÚ	IIterableÚ	IIteratorÚ	IKeysViewÚIMappingÚIMappingViewÚIMutableMappingÚIMutableSequenceÚIMutableSetÚIReversibleÚ	ISequenceÚISetÚISizedÚIValuesViewc                   @   ó   e Zd ZejZedd„ ƒZdS )r#   c                 C   ó   dS )z¢
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__getitem__`` protocol
        to implement ``in``.
        Nr   ©Úotherr   r   r   Ú__contains__z   ó    zIContainer.__contains__N)Ú__name__Ú
__module__Ú__qualname__r   Ú	Containerr   r9   r   r   r   r   r#   w   ó    r#   c                   @   ó   e Zd ZejZdS )r&   N)r;   r<   r=   r   ÚHashabler   r   r   r   r&   ‚   ó    
r&   c                   @   r5   )r(   c                   C   r6   ©z‰
        Optional method. If not provided, the interpreter will
        implement `iter` using the old ``__getitem__`` protocol.
        Nr   r   r   r   r   Ú__iter__ˆ   r:   zIIterable.__iter__N)r;   r<   r=   r   ÚIterabler   rD   r   r   r   r   r(   …   r?   r(   c                   @   r@   )r)   N)r;   r<   r=   r   ÚIteratorr   r   r   r   r)   �   rB   r)   c                   @   s*   e Zd Zedee ¡ fƒZedd„ ƒZ	dS )r0   Ú
Reversiblec                   C   r6   ©z§
        Optional method. If this isn't present, the interpreter
        will use ``__len__`` and ``__getitem__`` to implement the
        `reversed` builtin.
        Nr   r   r   r   r   Ú__reversed__•   r:   zIReversible.__reversed__N)
r;   r<   r=   r   ÚPY36r(   ÚgetABCr   r   rI   r   r   r   r   r0   ’   s    r0   c                   @   s   e Zd Zedee ¡ fƒZdS )r%   Ú	GeneratorN)r;   r<   r=   r   ÚPY35r)   rK   r   r   r   r   r   r%   �   s    r%   c                   @   r@   )r3   N)r;   r<   r=   r   ÚSizedr   r   r   r   r3   ¢   rB   r3   c                   @   s*   e Zd Zedee ¡ e ¡ e ¡ fƒZ	dS )r"   Ú
CollectionN)
r;   r<   r=   r   rJ   r3   rK   r(   r#   r   r   r   r   r   r"   ¨   s    ÿr"   c                   @   sB   e Zd ZejZefZeeu re	fndZ
edd„ ƒZedd„ ƒZdS )r1   r   c                   C   r6   rH   r   r   r   r   r   rI   ¸   r:   zISequence.__reversed__c                   C   r6   rC   r   r   r   r   r   rD   À   r:   zISequence.__iter__N)r;   r<   r=   r   ÚSequencer   Úextra_classesÚstrÚbytesÚ
basestringÚignored_classesr   rI   rD   r   r   r   r   r1   ¯   s    
r1   c                   @   s   e Zd ZejZefZdS )r.   N)r;   r<   r=   r   ÚMutableSequencer   rQ   r   r   r   r   r.   Ç   s    
r.   c                   @   s(   e Zd ZdZedee ¡ fee	fƒZ
dS )ÚIByteStringz/
    This unifies `bytes` and `bytearray`.
    Ú
ByteStringN)r;   r<   r=   r   r   ÚPY3r1   rK   rS   Ú	bytearrayr   r   r   r   r   rW   Ì   s    þrW   c                   @   r@   )r2   N)r;   r<   r=   r   ÚSetr   r   r   r   r2   Õ   rB   r2   c                   @   r@   )r/   N)r;   r<   r=   r   Ú
MutableSetr   r   r   r   r/   Ù   rB   r/   c                   @   s6   e Zd ZejZefZefZe	re
dd„ ƒZeZdS dS )r+   c                 C   r6   )z:
            The interpreter will supply one.
            Nr   r7   r   r   r   Ú__eq__æ   r:   zIMapping.__eq__N)r;   r<   r=   r   ÚMappingÚdictrQ   r   rU   ÚPY2r   r]   Ú__ne__r   r   r   r   r+   Ý   s    
ùr+   c                   @   s    e Zd ZejZeefZefZ	dS )r-   N)
r;   r<   r=   r   ÚMutableMappingr_   r   rQ   r   rU   r   r   r   r   r-   ï   s    
r-   c                   @   r@   )r,   N)r;   r<   r=   r   ÚMappingViewr   r   r   r   r,   ô   rB   r,   c                   @   r@   )r'   N)r;   r<   r=   r   Ú	ItemsViewr   r   r   r   r'   ø   rB   r'   c                   @   r@   )r*   N)r;   r<   r=   r   ÚKeysViewr   r   r   r   r*   ü   rB   r*   c                   @   r5   )r4   c                 C   r6   )z²
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__len__`` and ``__getitem__`` protocol
        to implement ``in``.
        Nr   r7   r   r   r   r9     r:   zIValuesView.__contains__N)r;   r<   r=   r   Ú
ValuesViewr   r9   r   r   r   r   r4      r?   r4   c                   @   ó   e Zd ZedeƒZdS )r!   Ú	AwaitableN©r;   r<   r=   r   rM   r   r   r   r   r   r!     ó    r!   c                   @   rg   )r$   Ú	CoroutineNri   r   r   r   r   r$     rj   r$   c                   @   rg   )r   ÚAsyncIterableNri   r   r   r   r   r     rj   r   c                   @   rg   )r    ÚAsyncIteratorNri   r   r   r   r   r      rj   r    c                   @   rg   )r   ÚAsyncGeneratorN)r;   r<   r=   r   rJ   r   r   r   r   r   r     rj   r   )2r   Ú
__future__r   Úsysr   r   ÚcollectionsÚImportErrorr   r   r   r   r	   Úzope.interface._compatr
   r`   r   rY   Úzope.interface.commonr   r   Úversion_inforM   rJ   r   Ú__all__r#   r&   r(   r)   r0   r%   r3   r"   r1   r.   rW   r2   r/   r+   r-   r,   r'   r*   r4   r!   r$   r   r    r   r   r   r   r   Ú<module>   st   ÿü
þ
þÿ	