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)nameZverZbases_if_missingZ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   r6   r   r   r   r   r    w       r    c                   @      e Zd ZejZdS )r#   N)r8   r9   r:   r   Hashabler   r   r   r   r#          
r#   c                   @   r2   )r%   c                   C   r3   z
        Optional method. If not provided, the interpreter will
        implement `iter` using the old ``__getitem__`` protocol.
        Nr   r   r   r   r   __iter__   r7   zIIterable.__iter__N)r8   r9   r:   r   Iterabler   rA   r   r   r   r   r%      r<   r%   c                   @   r=   )r&   N)r8   r9   r:   r   Iteratorr   r   r   r   r&      r?   r&   c                   @   s*   e Zd Zedee fZedd Z	dS )r-   
Reversiblec                   C   r3   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__   r7   zIReversible.__reversed__N)
r8   r9   r:   r   PY36r%   getABCr   r   rF   r   r   r   r   r-      s    r-   c                   @   s   e Zd Zedee fZdS )r"   	GeneratorN)r8   r9   r:   r   PY35r&   rH   r   r   r   r   r   r"      s    r"   c                   @   r=   )r0   N)r8   r9   r:   r   Sizedr   r   r   r   r0      r?   r0   c                   @   s*   e Zd Zedee e e fZ	dS )r   
CollectionN)
r8   r9   r:   r   rG   r0   rH   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   r3   rE   r   r   r   r   r   rF      r7   zISequence.__reversed__c                   C   r3   r@   r   r   r   r   r   rA      r7   zISequence.__iter__N)r8   r9   r:   r   Sequencer   extra_classesstrbytesZ
basestringignored_classesr   rF   rA   r   r   r   r   r.      s    
r.   c                   @   s   e Zd ZejZefZdS )r+   N)r8   r9   r:   r   MutableSequencer   rN   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)r8   r9   r:   r   r   PY3r.   rH   rP   	bytearrayr   r   r   r   r   rS      s    rS   c                   @   r=   )r/   N)r8   r9   r:   r   Setr   r   r   r   r/      r?   r/   c                   @   r=   )r,   N)r8   r9   r:   r   
MutableSetr   r   r   r   r,      r?   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   r3   )z:
            The interpreter will supply one.
            Nr   r4   r   r   r   __eq__   r7   zIMapping.__eq__N)r8   r9   r:   r   MappingdictrN   r   rQ   PY2r   rY   __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)
r8   r9   r:   r   MutableMappingr[   r   rN   r   rQ   r   r   r   r   r*      s    
r*   c                   @   r=   )r)   N)r8   r9   r:   r   MappingViewr   r   r   r   r)      r?   r)   c                   @   r=   )r$   N)r8   r9   r:   r   	ItemsViewr   r   r   r   r$      r?   r$   c                   @   r=   )r'   N)r8   r9   r:   r   KeysViewr   r   r   r   r'      r?   r'   c                   @   r2   )r1   c                 C   r3   )z
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__len__`` and ``__getitem__`` protocol
        to implement ``in``.
        Nr   r4   r   r   r   r6     r7   zIValuesView.__contains__N)r8   r9   r:   r   
ValuesViewr   r6   r   r   r   r   r1      r<   r1   c                   @      e Zd ZedeZdS )r   	AwaitableNr8   r9   r:   r   rJ   r   r   r   r   r   r         r   c                   @   rc   )r!   	CoroutineNre   r   r   r   r   r!     rf   r!   c                   @   rc   )r   AsyncIterableNre   r   r   r   r   r     rf   r   c                   @   rc   )r   AsyncIteratorNre   r   r   r   r   r     rf   r   c                   @   rc   )r   AsyncGeneratorN)r8   r9   r:   r   rG   r   r   r   r   r   r     rf   r   )2r   Z
__future__r   sysr   r   collectionsImportErrorr   r   r   r   r	   Zzope.interface._compatr
   r\   r   rU   Zzope.interface.commonr   r   version_inforJ   rG   r   __all__r    r#   r%   r&   r-   r"   r0   r   r.   r+   rS   r/   r,   r(   r*   r)   r$   r'   r1   r   r!   r   r   r   r   r   r   r   <module>   st   

	