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

��eE�	�F�dZddlmZddlmZGd�de�ZGd�deje�ZGd�d	e�ZGd
�deje�Z
Gd�d
ee
�ZGd�de
�ZGd�de�Z
Gd�de�ZGd�de�ZGd�dej eee
e�Zy)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��eZdZdZd�Zy)�IItemMappingz%Simplest readable mapping object
    c��y)z`Get a value for a key

        A `KeyError` is raised if there is no value for the key.
        N���keys �?/usr/lib/python3/dist-packages/zope/interface/common/mapping.py�__getitem__zIItemMapping.__getitem__&���N)�__name__�
__module__�__qualname__�__doc__rrrrrr"s���rrc��eZdZdZdd�Zd�Zy)�IReadMappingz^
    Basic mapping interface.

    .. versionchanged:: 5.0.0
       Extend ``IContainer``
    Nc��y)zaGet a value for a key

        The default is returned if there is no value for the key.
        Nr�r
�defaults  r�getzIReadMapping.get5r
rc��y)z$Tell if a key exists in the mapping.Nrr	s r�__contains__zIReadMapping.__contains__;r
r�N)rrrrrrrrrrr-s����3rrc��eZdZdZd�Zd�Zy)�
IWriteMappingz!Mapping methods for changing datac��y)z.Delete a value from the mapping using the key.Nrr	s r�__delitem__zIWriteMapping.__delitem__Cr
rc��y)zSet a new item in the mapping.Nr)r
�values  r�__setitem__zIWriteMapping.__setitem__Fr
rN)rrrrrr"rrrrr@s��+�=�-rrc�(�eZdZdZd�Zd�Zd�Zd�Zy)�IEnumerableMappingzp
    Mapping objects whose items can be enumerated.

    .. versionchanged:: 5.0.0
       Extend ``ISized``
    c��y)z/Return the keys of the mapping object.
        Nrrrr�keyszIEnumerableMapping.keysRr
rc��y)z?Return an iterator for the keys of the mapping object.
        Nrrrr�__iter__zIEnumerableMapping.__iter__Vr
rc��y)z1Return the values of the mapping object.
        Nrrrr�valueszIEnumerableMapping.valuesZr
rc��y)z0Return the items of the mapping object.
        Nrrrr�itemszIEnumerableMapping.items^r
rN)rrrrr&r(r*r,rrrr$r$Js������rr$c��eZdZdZy)�IMappingz Simple mapping interface N�rrrrrrrr.r.bs��$rr.c��eZdZdZy)�IIterableMappingzLA mapping that has distinct methods for iterating
    without copying.

    Nr/rrrr1r1es��rr1c��eZdZdZd�Zy)�IClonableMappingzSSomething that can produce a copy of itself.

    This is available in `dict`.
    c��y)zreturn copy of dictNrrrr�copyzIClonableMapping.copyrr
rN)rrrrr5rrrr3r3ls���
rr3c��eZdZdZy)�IExtendedReadMappingz�
    Something with a particular method equivalent to ``__contains__``.

    On Python 2, `dict` provided the ``has_key`` method, but it was removed
    in Python 3.
    Nr/rrrr7r7us��rr7c�2�eZdZdZd�Zd�Zdd�Zdd�Zd�Zy)	�IExtendedWriteMappingzHAdditional mutation methods.

    These are all provided by `dict`.
    c��y)zdelete all itemsNrrrr�clearzIExtendedWriteMapping.clear�r
rc��y)z0 Update D from E: for k in E.keys(): D[k] = E[k]Nr)�ds r�updatezIExtendedWriteMapping.update�r
rNc��y)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in DNrrs  r�
setdefaultz IExtendedWriteMapping.setdefault�r
rc��y)a
        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)�krs  r�popzIExtendedWriteMapping.pop�r
rc��y)zeremove and return some (key, value) pair as a
        2-tuple; but raise KeyError if mapping is emptyNrrrr�popitemzIExtendedWriteMapping.popitem�r
rr)	rrrrr;r>r@rCrErrrr9r9~s!���
�;�K�	�;rr9c��eZdZdZy)�IFullMappinga$
    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``
    Nr/rrrrGrG�s��	rrGN)r�zope.interfacer�zope.interface.commonrr�
IContainerrr�ISizedr$r.r1r3r7r9�IMutableMappingrGrrr�<module>rMs����"%�-��9��3�;�)�)�<�3�&-�I�-���+�+�\��0%�}�0�%��)���y���+��;�M�;�<��#�#��3�5E�x�r