Current File : //usr/lib/python3/dist-packages/zope/interface/common/__pycache__/collections.cpython-312.pyc
�

��e����dZddlZddlmZddlmZddlmZddlmZddlmZddlmZdd	l	m
Z
dd
l	mZefdfd�Zgd
�Z
Gd�de
�ZGd�de
�ZGd�de
�ZGd�de�ZGd�de�ZGd�de�ZGd�de
�ZGd�deee�ZGd�dee�ZGd �d!e�ZGd"�d#e�ZGd$�d%e�ZGd&�d'e�ZGd(�d)e�ZGd*�d+e�ZGd,�d-e�ZGd.�d/ee�ZGd0�d1ee�ZGd2�d3ee�Z Gd4�d5e
�Z!Gd6�d7e!�Z"Gd8�d9e
�Z#Gd:�d;e#�Z$Gd<�d=e$�Z%y)>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)�abc)�OrderedDict)�UserList)�UserDict)�
UserString)�ABCInterface)�optional�c�~�|rtt|�St||dd|zi�}|D]}|j|��|S)N�__doc__z4The ABC %s is not defined in this version of Python.)�getattrrr�register)�name�ver�bases_if_missing�register_if_missing�missing�cs      �C/usr/lib/python3/dist-packages/zope/interface/common/collections.py�_new_in_verr3s^����s�D�!�!��d�,��I��
�/��G�!����������N�)�IAsyncGenerator�IAsyncIterable�IAsyncIterator�
IAwaitable�ICollection�
IContainer�
ICoroutine�
IGenerator�	IHashable�
IItemsView�	IIterable�	IIterator�	IKeysView�IMapping�IMappingView�IMutableMapping�IMutableSequence�IMutableSet�IReversible�	ISequence�ISet�ISized�IValuesViewc�4�eZdZejZed��Zy)rc��y)z�
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__getitem__`` protocol
        to implement ``in``.
        Nr��others r�__contains__zIContainer.__contains__c��rN)�__name__�
__module__�__qualname__r�	Containerr
r4rrrrr`s��

�-�-�C�
���rrc�$�eZdZejZy)r!N)r6r7r8r�Hashablerrrr!r!k���

�,�,�Crr!c�4�eZdZejZed��Zy)r#c��y�z�
        Optional method. If not provided, the interpreter will
        implement `iter` using the old ``__getitem__`` protocol.
        Nrrrr�__iter__zIIterable.__iter__qr5rN)r6r7r8r�Iterabler
r@rrrr#r#ns��

�,�,�C�
���rr#c�$�eZdZejZy)r$N)r6r7r8r�Iteratorrrrr$r$xr<rr$c�N�eZdZeddej�f�Zed��Zy)r+�
ReversibleTc��y�z�
        Optional method. If this isn't present, the interpreter
        will use ``__len__`` and ``__getitem__`` to implement the
        `reversed` builtin.
        Nrrrr�__reversed__zIReversible.__reversed__~r5rN)	r6r7r8rr#�getABCrr
rHrrrr+r+{s.��
�l�D�9�+;�+;�+=�*?�
@�C�
���rr+c�>�eZdZeddej�f�Zy)r �	GeneratorTN)r6r7r8rr$rIrrrrr r �s��
�k�4�)�*:�*:�*<�)>�
?�Crr c�$�eZdZejZy)r.N)r6r7r8r�Sizedrrrr.r.�s��

�)�)�Crr.c�z�eZdZeddej�ej�ej�f�Zy)r�
CollectionTN)	r6r7r8rr.rIr#rrrrrrr�s5���l�D��}�}��	�(8�(8�(:�J�<M�<M�<O�P�R�Crrc�\�eZdZejZefZeeure	fndZ
ed��Zed��Z
y)r,rc��yrGrrrrrHzISequence.__reversed__�r5rc��yr?rrrrr@zISequence.__iter__�r5rN)r6r7r8r�Sequencer�
extra_classes�str�bytes�
basestring�ignored_classesr
rHr@rrrr,r,�sI��

�,�,�C��M�M�(+�e�|�z�m��O�
�������rr,c�*�eZdZejZefZy)r)N)r6r7r8r�MutableSequencerrTrrrr)r)�s��

�
�
�C��K�Mrr)c�H�eZdZdZeddej
�feef�Z	y)�IByteStringz/
    This unifies `bytes` and `bytearray`.
    �
ByteStringTN)
r6r7r8r
rr,rIrV�	bytearrayrrrrr\r\�s.����l�D� �'�'�)�+��i�(�*�Crr\c�$�eZdZejZy)r-N)r6r7r8r�Setrrrr-r-�s��

�'�'�Crr-c�$�eZdZejZy)r*N)r6r7r8r�
MutableSetrrrr*r*�s��

�.�.�Crr*c�0�eZdZejZefZefZy)r&N)	r6r7r8r�Mapping�dictrTrrXrrrr&r&�s��

�+�+�C��G�M�
#�n�Orr&c�2�eZdZejZeefZefZ	y)r(N)
r6r7r8r�MutableMappingrerrTrrXrrrr(r(�s��

�
�
�C��8�%�M�"�n�Orr(c�$�eZdZejZy)r'N)r6r7r8r�MappingViewrrrr'r'�s��

�/�/�Crr'c�$�eZdZejZy)r"N)r6r7r8r�	ItemsViewrrrr"r"�s��

�-�-�Crr"c�$�eZdZejZy)r%N)r6r7r8r�KeysViewrrrr%r%�r<rr%c�4�eZdZejZed��Zy)r/c��y)z�
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__len__`` and ``__getitem__`` protocol
        to implement ``in``.
        Nrr2s rr4zIValuesView.__contains__�r5rN)r6r7r8r�
ValuesViewr
r4rrrr/r/�s��

�.�.�C�
���rr/c��eZdZedd�Zy)r�	AwaitableTN�r6r7r8rrrrrrr����
�k�4�
(�Crrc��eZdZedd�Zy)r�	CoroutineTNrsrrrrr�rtrrc��eZdZedd�Zy)r�
AsyncIterableTNrsrrrrr����
�o�t�
,�Crrc��eZdZedd�Zy)r�
AsyncIteratorTNrsrrrrr�ryrrc��eZdZedd�Zy)r�AsyncGeneratorTNrsrrrrr�s��
�&��
-�Crr)&r
�sysrr�collectionsrrrr�zope.interface.commonr	r
r�__all__rr!r#r$r+r r.rr,r)r\r-r*r&r(r'r"r%r/rrrrrrrr�<module>r�sp���*���#� � �"�.�*�#*��$&��&��4	��	��������	��	�)�	�@��@�
�\��R�&���R�����0 �y� �
*�)�*��;���$��%�{�%�%�h�%�
�6����t����d��	�,��	�)��)�)��)�-�\�-�-�^�-�.�n�.r