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   

	