
    Vh                        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Zg dZ G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d deee      Z G d d ee      Z G d! d"e      Ze
r G d# d$e      Z G d% d&e      Z G d' d(e      Z G d) d*e      Z G d+ d,e      Z G d- d.e      Z G d/ d0ee      Z  G d1 d2ee      Z! G d3 d4ee      Z" G d5 d6e      Z# G d7 d8e#      Z$ G d9 d:e      Z% G d; d<e%      Z& G d= 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)OrderedDict)UserDict)UserList)
UserString)abc)PY313_OR_OLDER)ABCInterface)optional c                 ~    |rt        t        |       S t        | |dd| z  i      }|D ]  }|j                  |        |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cs         Q/home/dcms/DCMS/lib/python3.12/site-packages/zope/interface/common/collections.py_new_in_verr   4   s^     sD!! 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    e Zd Zej                  Zed        Zy)r   c                      y)z
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__getitem__`` protocol
        to implement ``in``.
        Nr   others    r   __contains__zIContainer.__contains__f       r   N)__name__
__module____qualname__r   	Containerr   r5   r   r   r   r   r   c   s    
--C r   r   c                   $    e Zd Zej                  Zy)r"   N)r7   r8   r9   r   Hashabler   r   r   r"   r"   o       
,,Cr   r"   c                   4    e Zd Zej                  Zed        Zy)r$   c                       yz
        Optional method. If not provided, the interpreter will
        implement `iter` using the old ``__getitem__`` protocol.
        Nr   r   r   r   __iter__zIIterable.__iter__v   r6   r   N)r7   r8   r9   r   Iterabler   rA   r   r   r   r$   r$   s   s    
,,C r   r$   c                   $    e Zd Zej                  Zy)r%   N)r7   r8   r9   r   Iteratorr   r   r   r%   r%   ~   r=   r   r%   c                   N    e Zd Z eddej                         f      Zed        Zy)r,   
ReversibleTc                       yz
        Optional method. If this isn't present, the interpreter
        will use ``__len__`` and ``__getitem__`` to implement the
        `reversed` builtin.
        Nr   r   r   r   __reversed__zIReversible.__reversed__   r6   r   N)	r7   r8   r9   r   r$   getABCr   r   rI   r   r   r   r,   r,      s.    
lD9+;+;+=*?
@C r   r,   c                   >    e Zd Z eddej                         f      Zy)r!   	GeneratorTN)r7   r8   r9   r   r%   rJ   r   r   r   r   r!   r!      s    
k4)*:*:*<)>
?Cr   r!   c                   $    e Zd Zej                  Zy)r/   N)r7   r8   r9   r   Sizedr   r   r   r/   r/      s    
))Cr   r/   c                   z    e Zd Z eddej                         ej                         ej                         f      Zy)r   
CollectionTN)	r7   r8   r9   r   r/   rJ   r$   r   r   r   r   r   r   r      s6     	)**,j.?.?.ABCr   r   c                   N    e Zd Zej                  ZefZdZed        Z	ed        Z
y)r-   r   c                       yrH   r   r   r   r   rI   zISequence.__reversed__   r6   r   c                       yr@   r   r   r   r   rA   zISequence.__iter__   r6   r   N)r7   r8   r9   r   Sequencer   extra_classesignored_classesr   rI   rA   r   r   r   r-   r-      s?    
,,CMM O   r   r-   c                   *    e Zd Zej                  ZefZy)r*   N)r7   r8   r9   r   MutableSequencer   rU   r   r   r   r*   r*      s    


CKMr   r*   c                   H    e Zd ZdZ eddej                         feef      Z	y)IByteStringz7
        This unifies `bytes` and `bytearray`.
        
ByteStringTN)
r7   r8   r9   r   r   r-   rJ   bytes	bytearrayr   r   r   r   rZ   rZ      s-    	 $!1!1!3 5y7I
r   rZ   c                   $    e Zd Zej                  Zy)r.   N)r7   r8   r9   r   Setr   r   r   r.   r.      s    
''Cr   r.   c                   $    e Zd Zej                  Zy)r+   N)r7   r8   r9   r   
MutableSetr   r   r   r+   r+      s    
..Cr   r+   c                   0    e Zd Zej                  ZefZefZy)r'   N)	r7   r8   r9   r   MappingdictrU   r   rV   r   r   r   r'   r'      s    
++CGM
 #nOr   r'   c                   2    e Zd Zej                  ZeefZefZ	y)r)   N)
r7   r8   r9   r   MutableMappingrd   r   rU   r   rV   r   r   r   r)   r)      s    


C8%M"nOr   r)   c                   $    e Zd Zej                  Zy)r(   N)r7   r8   r9   r   MappingViewr   r   r   r(   r(      s    
//Cr   r(   c                   $    e Zd Zej                  Zy)r#   N)r7   r8   r9   r   	ItemsViewr   r   r   r#   r#      s    
--Cr   r#   c                   $    e Zd Zej                  Zy)r&   N)r7   r8   r9   r   KeysViewr   r   r   r&   r&      r=   r   r&   c                   4    e Zd Zej                  Zed        Zy)r0   c                      y)z
        Optional method. If not provided, the interpreter will use
        ``__iter__`` or the old ``__len__`` and ``__getitem__`` protocol
        to implement ``in``.
        Nr   r3   s    r   r5   zIValuesView.__contains__   r6   r   N)r7   r8   r9   r   
ValuesViewr   r5   r   r   r   r0   r0      s    
..C r   r0   c                       e Zd Z edd      Zy)r   	AwaitableTNr7   r8   r9   r   r   r   r   r   r   r          
k4
(Cr   r   c                       e Zd Z edd      Zy)r    	CoroutineTNrr   r   r   r   r    r       rs   r   r    c                       e Zd Z edd      Zy)r   AsyncIterableTNrr   r   r   r   r   r         
ot
,Cr   r   c                       e Zd Z edd      Zy)r   AsyncIteratorTNrr   r   r   r   r   r     rx   r   r   c                       e Zd Z edd      Zy)r   AsyncGeneratorTNrr   r   r   r   r   r     s    
&
-Cr   r   )(r   sysr   r   collectionsr   r   r   r   zope.interface._compatr	   zope.interface.commonr
   r   r   __all__r   r"   r$   r%   r,   r!   r/   r   r-   r*   rZ   r.   r+   r'   r)   r(   r#   r&   r0   r   r    r   r   r   r   r   r   <module>r      sv  *   #     "  1 . * #*$&(6	 	  	 	) 	@ @
\ &2 y  
 
i 
; $ %{ %%h %6 t d 	, 	) )) )-\ --^ -.n .r   