a
    _                     @   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yN   ddlZY n0 ddlmZ z(ddlm	Z	 ddlm
Z
 dd	lmZ W n6 ey   ddl	m	Z	 dd
l
mZ
 dd	lmZ Y n0 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)nameZverZbases_if_missingZregister_if_missingZ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                   @   s   e Zd ZejZedd ZdS )r   c                 C   s   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   s    zIContainer.__contains__N)__name__
__module____qualname__r   	Containerr   r3   r   r   r   r   r   w   s   r   c                   @   s   e Zd ZejZdS )r"   N)r4   r5   r6   r   Hashabler   r   r   r   r"      s   r"   c                   @   s   e Zd ZejZedd ZdS )r$   c                   C   s   dS z
        Optional method. If not provided, the interpreter will
        implement `iter` using the old ``__getitem__`` protocol.
        Nr   r   r   r   r   __iter__   s    zIIterable.__iter__N)r4   r5   r6   r   Iterabler   r:   r   r   r   r   r$      s   r$   c                   @   s   e Zd ZejZdS )r%   N)r4   r5   r6   r   Iteratorr   r   r   r   r%      s   r%   c                   @   s*   e Zd Zedee fZedd Z	dS )r,   
Reversiblec                   C   s   dS 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__   s    zIReversible.__reversed__N)
r4   r5   r6   r   PY36r$   getABCr   r   r?   r   r   r   r   r,      s   r,   c                   @   s   e Zd Zedee fZdS )r!   	GeneratorN)r4   r5   r6   r   PY35r%   rA   r   r   r   r   r   r!      s   r!   c                   @   s   e Zd ZejZdS )r/   N)r4   r5   r6   r   Sizedr   r   r   r   r/      s   r/   c                   @   s*   e Zd Zedee e e fZ	dS )r   
CollectionN)
r4   r5   r6   r   r@   r/   rA   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 )r-   r   c                   C   s   dS r>   r   r   r   r   r   r?      s    zISequence.__reversed__c                   C   s   dS r9   r   r   r   r   r   r:      s    zISequence.__iter__N)r4   r5   r6   r   Sequencer   extra_classesstrbytesZ
basestringignored_classesr   r?   r:   r   r   r   r   r-      s   
r-   c                   @   s   e Zd ZejZefZdS )r*   N)r4   r5   r6   r   MutableSequencer   rG   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)r4   r5   r6   r   r   PY3r-   rA   rI   	bytearrayr   r   r   r   r   rL      s
   rL   c                   @   s   e Zd ZejZdS )r.   N)r4   r5   r6   r   Setr   r   r   r   r.      s   r.   c                   @   s   e Zd ZejZdS )r+   N)r4   r5   r6   r   
MutableSetr   r   r   r   r+      s   r+   c                   @   s2   e Zd ZejZefZefZe	r.e
dd ZeZdS )r'   c                 C   s   dS )z:
            The interpreter will supply one.
            Nr   r1   r   r   r   __eq__   s    zIMapping.__eq__N)r4   r5   r6   r   MappingdictrG   r   rJ   PY2r   rR   __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)
r4   r5   r6   r   MutableMappingrT   r   rG   r   rJ   r   r   r   r   r)      s   r)   c                   @   s   e Zd ZejZdS )r(   N)r4   r5   r6   r   MappingViewr   r   r   r   r(      s   r(   c                   @   s   e Zd ZejZdS )r#   N)r4   r5   r6   r   	ItemsViewr   r   r   r   r#      s   r#   c                   @   s   e Zd ZejZdS )r&   N)r4   r5   r6   r   KeysViewr   r   r   r   r&      s   r&   c                   @   s   e Zd ZejZedd ZdS )r0   c                 C   s   dS )z
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__len__`` and ``__getitem__`` protocol
        to implement ``in``.
        Nr   r1   r   r   r   r3     s    zIValuesView.__contains__N)r4   r5   r6   r   
ValuesViewr   r3   r   r   r   r   r0      s   r0   c                   @   s   e Zd ZedeZdS )r   	AwaitableNr4   r5   r6   r   rC   r   r   r   r   r   r     s   r   c                   @   s   e Zd ZedeZdS )r    	CoroutineNr]   r   r   r   r   r      s   r    c                   @   s   e Zd ZedeZdS )r   AsyncIterableNr]   r   r   r   r   r     s   r   c                   @   s   e Zd ZedeZdS )r   AsyncIteratorNr]   r   r   r   r   r     s   r   c                   @   s   e Zd ZedeZdS )r   AsyncGeneratorN)r4   r5   r6   r   r@   r   r   r   r   r   r     s   r   )2r   Z
__future__r   sysr   r   collectionsImportErrorr   r   r   r   r	   Zzope.interface._compatr
   rU   r   rN   Zzope.interface.commonr   r   version_inforC   r@   r   __all__r   r"   r$   r%   r,   r!   r/   r   r-   r*   rL   r.   r+   r'   r)   r(   r#   r&   r0   r   r    r   r   r   r   r   r   r   <module>   sn   

	