U
    1ÜŸj™  ã                   @   sP  d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	l	m
Z
 dd
lmZ ddlmZ efdfdd„Zdddddddddddddddddd d!d"d#d$d%g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e
�rvG d0d1„ d1eƒZG d2d#„ d#eƒZG d3d „ d eƒZG d4d„ deƒZG d5d„ deƒZG d6d„ deƒZG d7d„ deeƒZ G d8d„ deeƒZ!G d9d%„ 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 d>d„ de&ƒZ'dS )?aó  
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
é    N)ÚABCMeta)ÚOrderedDict)ÚUserDict)ÚUserList)Ú
UserString)Úabc)ÚPY313_OR_OLDER)ÚABCInterface)Úoptional© 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ÚverZbases_if_missingZregister_if_missingÚmissingÚcr   r   úE/tmp/pip-unpacked-wheel-qz07cfz6/zope/interface/common/collections.pyÚ_new_in_ver4   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__f   s    zIContainer.__contains__N)Ú__name__Ú
__module__Ú__qualname__r   Ú	Containerr
   r.   r   r   r   r   r   c   s   c                   @   s   e Zd ZejZdS )r   N)r/   r0   r1   r   ÚHashabler   r   r   r   r   o   s   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__v   s    zIIterable.__iter__N)r/   r0   r1   r   ÚIterabler
   r5   r   r   r   r   r   s   s   c                   @   s   e Zd ZejZdS )r    N)r/   r0   r1   r   ÚIteratorr   r   r   r   r    ~   s   c                   @   s*   e Zd Zedde ¡ fƒZedd„ ƒZdS )r'   Ú
ReversibleTc                   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)	r/   r0   r1   r   r   ÚgetABCr   r
   r:   r   r   r   r   r'   ‚   s   c                   @   s   e Zd Zedde ¡ fƒZdS )r   Ú	GeneratorTN)r/   r0   r1   r   r    r;   r   r   r   r   r   r   Ž   s   c                   @   s   e Zd ZejZdS )r*   N)r/   r0   r1   r   ÚSizedr   r   r   r   r*   “   s   c                   @   s*   e Zd Zedde ¡ e ¡ e ¡ fƒZdS )r   Ú
CollectionTN)	r/   r0   r1   r   r*   r;   r   r   r   r   r   r   r   r   š   s
   ýc                   @   s4   e Zd ZejZefZdZedd„ ƒZ	edd„ ƒZ
dS )r(   r   c                   C   s   dS r9   r   r   r   r   r   r:   ­   s    zISequence.__reversed__c                   C   s   dS r4   r   r   r   r   r   r5   µ   s    zISequence.__iter__N)r/   r0   r1   r   ÚSequencer   Úextra_classesÚignored_classesr
   r:   r5   r   r   r   r   r(   ¤   s   
c                   @   s   e Zd ZejZefZdS )r%   N)r/   r0   r1   r   ÚMutableSequencer   r@   r   r   r   r   r%   ½   s   c                   @   s(   e Zd ZdZedde ¡ feefƒZ	dS )ÚIByteStringz7
        This unifies `bytes` and `bytearray`.
        Ú
ByteStringTN)
r/   r0   r1   r   r   r(   r;   ÚbytesÚ	bytearrayr   r   r   r   r   rC   Ã   s      ÿrC   c                   @   s   e Zd ZejZdS )r)   N)r/   r0   r1   r   ÚSetr   r   r   r   r)   Ì   s   c                   @   s   e Zd ZejZdS )r&   N)r/   r0   r1   r   Ú
MutableSetr   r   r   r   r&   Ð   s   c                   @   s   e Zd ZejZefZefZdS )r"   N)	r/   r0   r1   r   ÚMappingÚdictr@   r   rA   r   r   r   r   r"   Ô   s   c                   @   s    e Zd ZejZeefZefZ	dS )r$   N)
r/   r0   r1   r   ÚMutableMappingrJ   r   r@   r   rA   r   r   r   r   r$   Þ   s   c                   @   s   e Zd ZejZdS )r#   N)r/   r0   r1   r   ÚMappingViewr   r   r   r   r#   ä   s   c                   @   s   e Zd ZejZdS )r   N)r/   r0   r1   r   Ú	ItemsViewr   r   r   r   r   è   s   c                   @   s   e Zd ZejZdS )r!   N)r/   r0   r1   r   ÚKeysViewr   r   r   r   r!   ì   s   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 use
        ``__iter__`` or the old ``__len__`` and ``__getitem__`` protocol
        to implement ``in``.
        Nr   r,   r   r   r   r.   ó   s    zIValuesView.__contains__N)r/   r0   r1   r   Ú
ValuesViewr
   r.   r   r   r   r   r+   ð   s   c                   @   s   e Zd ZeddƒZdS )r   Ú	AwaitableTN©r/   r0   r1   r   r   r   r   r   r   r   ü   s   c                   @   s   e Zd ZeddƒZdS )r   Ú	CoroutineTNrQ   r   r   r   r   r      s   c                   @   s   e Zd ZeddƒZdS )r   ÚAsyncIterableTNrQ   r   r   r   r   r     s   c                   @   s   e Zd ZeddƒZdS )r   ÚAsyncIteratorTNrQ   r   r   r   r   r     s   c                   @   s   e Zd ZeddƒZdS )r   ÚAsyncGeneratorTNrQ   r   r   r   r   r     s   )(r   Úsysr   r   Úcollectionsr   r   r   r   Zzope.interface._compatr   Zzope.interface.commonr	   r
   r   Ú__all__r   r   r   r    r'   r   r*   r   r(   r%   rC   r)   r&   r"   r$   r#   r   r!   r+   r   r   r   r   r   r   r   r   r   Ú<module>   s†   
þ
éþ
ÿ	
