
    (phO              	       F   S r SSKJr  SSKJr   " S S\5      r " S S\R                  \5      r " S S	\5      r " S
 S\R                  \5      r
 " S S\\
5      r " S S\
5      r " S S\5      r " S S\5      r " S S\5      r " S S\R                   \\\\5      rg)ah  
Mapping Interfaces.

Importing this module does *not* mark any standard classes as
implementing any of these interfaces.

While this module is not deprecated, new code should generally use
:mod:`zope.interface.common.collections`, specifically
:class:`~zope.interface.common.collections.IMapping` and
:class:`~zope.interface.common.collections.IMutableMapping`. This
module is occasionally useful for its extremely fine grained breakdown
of interfaces.

The standard library :class:`dict` and :class:`collections.UserDict`
implement ``IMutableMapping``, but *do not* implement any of the
interfaces in this module.
    )	Interface)collectionsc                       \ rS rSrSrS rSrg)IItemMapping#   z%Simplest readable mapping object
    c                     g)zPGet a value for a key

A `KeyError` is raised if there is no value for the key.
N keys    P/var/www/html/venv/lib/python3.13/site-packages/zope/interface/common/mapping.py__getitem__IItemMapping.__getitem__'           r	   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__r	   r   r   r   r   #   s    r   r   c                   (    \ rS rSrSrSS jrS rSrg)IReadMapping.   zN
Basic mapping interface.

.. versionchanged:: 5.0.0
   Extend ``IContainer``
Nc                     g)zQGet a value for a key

The default is returned if there is no value for the key.
Nr	   r   defaults     r   getIReadMapping.get6   r   r   c                     g)z$Tell if a key exists in the mapping.Nr	   r
   s    r   __contains__IReadMapping.__contains__<   r   r   r	   N)r   r   r   r   r   r   r    r   r	   r   r   r   r   .   s    3r   r   c                   $    \ rS rSrSrS rS rSrg)IWriteMappingA   z!Mapping methods for changing datac                     g)z.Delete a value from the mapping using the key.Nr	   r
   s    r   __delitem__IWriteMapping.__delitem__D   r   r   c                     g)zSet a new item in the mapping.Nr	   )r   values     r   __setitem__IWriteMapping.__setitem__G   r   r   r	   N)r   r   r   r   r   r'   r+   r   r	   r   r   r$   r$   A   s    +=-r   r$   c                   0    \ rS rSrSrS rS rS rS rSr	g)	IEnumerableMappingK   z`
Mapping objects whose items can be enumerated.

.. versionchanged:: 5.0.0
   Extend ``ISized``
c                      g)z/Return the keys of the mapping object.
        Nr	   r	   r   r   keysIEnumerableMapping.keysS   r   r   c                      g)z?Return an iterator for the keys of the mapping object.
        Nr	   r	   r   r   __iter__IEnumerableMapping.__iter__W   r   r   c                      g)z1Return the values of the mapping object.
        Nr	   r	   r   r   valuesIEnumerableMapping.values[   r   r   c                      g)z0Return the items of the mapping object.
        Nr	   r	   r   r   itemsIEnumerableMapping.items_   r   r   r	   N)
r   r   r   r   r   r1   r4   r7   r:   r   r	   r   r   r.   r.   K   s    r   r.   c                       \ rS rSrSrSrg)IMappingd   zSimple mapping interface r	   Nr   r   r   r   r   r   r	   r   r   r=   r=   d   s    $r   r=   c                       \ rS rSrSrSrg)IIterableMappingh   zDA mapping that has distinct methods for iterating
without copying.

r	   Nr?   r	   r   r   rA   rA   h   s    r   rA   c                       \ rS rSrSrS rSrg)IClonableMappingo   zKSomething that can produce a copy of itself.

This is available in `dict`.
c                      g)zreturn copy of dictNr	   r	   r   r   copyIClonableMapping.copyu   r   r   r	   N)r   r   r   r   r   rG   r   r	   r   r   rD   rD   o   s    
r   rD   c                       \ rS rSrSrSrg)IExtendedReadMappingy   z
Something with a particular method equivalent to ``__contains__``.

On Python 2, `dict` provided the ``has_key`` method, but it was removed
in Python 3.
r	   Nr?   r	   r   r   rJ   rJ   y   s    r   rJ   c                   >    \ rS rSrSrS rS rS
S jrS
S jrS r	S	r
g)IExtendedWriteMapping   z@Additional mutation methods.

These are all provided by `dict`.
c                      g)zdelete all itemsNr	   r	   r   r   clearIExtendedWriteMapping.clear   r   r   c                     g)z/Update D from E: for k in E.keys(): D[k] = E[k]Nr	   )ds    r   updateIExtendedWriteMapping.update   r   r   Nc                     g)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in DNr	   r   s     r   
setdefault IExtendedWriteMapping.setdefault   r   r   c                     g)z
pop(k[,default]) -> value

Remove specified key and return the corresponding value.

If key is not found, *default* is returned if given, otherwise
`KeyError` is raised. Note that *default* must not be passed by
name.
Nr	   )kr   s     r   popIExtendedWriteMapping.pop   r   r   c                      g)z]remove and return some (key, value) pair as a
2-tuple; but raise KeyError if mapping is emptyNr	   r	   r   r   popitemIExtendedWriteMapping.popitem   r   r   r	   r"   )r   r   r   r   r   rP   rT   rW   r[   r^   r   r	   r   r   rM   rM      s!    
;K	;r   rM   c                       \ rS rSrSrSrg)IFullMapping   a  
Full mapping interface.

Most uses of this interface should instead use
:class:`~zope.interface.commons.collections.IMutableMapping` (one of the
bases of this interface). The required methods are the same.

.. versionchanged:: 5.0.0
   Extend ``IMutableMapping``
r	   Nr?   r	   r   r   ra   ra      s    	r   ra   N)r   zope.interfacer   zope.interface.commonr   r   
IContainerr   r$   ISizedr.   r=   rA   rD   rJ   rM   IMutableMappingra   r	   r   r   <module>rh      s   " % -9 3;))< 3&-I -++\ 2%}0 %) y + ;M ;>r   