HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/zope/interface/common/__pycache__/mapping.cpython-39.pyc
a

��_R�@s�dZddlmZddlmZddlmZGdd�de�ZGdd�dej	e�Z
Gd	d
�d
e�ZGdd�deje
�Z
Gd
d�dee
�ZGdd�de
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�dejeeee�ZdS)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)�PYTHON2)�collectionsc@seZdZdZdd�ZdS)�IItemMappingz%Simplest readable mapping object
    cCsdS)z`Get a value for a key

        A `KeyError` is raised if there is no value for the key.
        N���keyrr�?/usr/lib/python3/dist-packages/zope/interface/common/mapping.py�__getitem__'szIItemMapping.__getitem__N)�__name__�
__module__�__qualname__�__doc__r
rrrr	r#src@s"eZdZdZddd�Zdd�ZdS)�IReadMappingz^
    Basic mapping interface.

    .. versionchanged:: 5.0.0
       Extend ``IContainer``
    NcCsdS)zaGet a value for a key

        The default is returned if there is no value for the key.
        Nr�r�defaultrrr	�get6szIReadMapping.getcCsdS)z$Tell if a key exists in the mapping.Nrrrrr	�__contains__<szIReadMapping.__contains__)N)rrr
rrrrrrr	r.s
rc@s eZdZdZdd�Zdd�ZdS)�
IWriteMappingz!Mapping methods for changing datacCsdS)z.Delete a value from the mapping using the key.Nrrrrr	�__delitem__DszIWriteMapping.__delitem__cCsdS)zSet a new item in the mapping.Nr)r�valuerrr	�__setitem__GszIWriteMapping.__setitem__N)rrr
rrrrrrr	rAsrc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�IEnumerableMappingzp
    Mapping objects whose items can be enumerated.

    .. versionchanged:: 5.0.0
       Extend ``ISized``
    cCsdS)z/Return the keys of the mapping object.
        Nrrrrr	�keysSszIEnumerableMapping.keyscCsdS)z?Return an iterator for the keys of the mapping object.
        Nrrrrr	�__iter__WszIEnumerableMapping.__iter__cCsdS)z1Return the values of the mapping object.
        Nrrrrr	�values[szIEnumerableMapping.valuescCsdS)z0Return the items of the mapping object.
        Nrrrrr	�items_szIEnumerableMapping.itemsN)rrr
rrrrrrrrr	rKs
rc@seZdZdZdS)�IMappingz Simple mapping interface N�rrr
rrrrr	rcsrc@s,eZdZdZer(dd�Zdd�Zdd�ZdS)	�IIterableMappingz�A mapping that has distinct methods for iterating
    without copying.

    On Python 2, a `dict` has these methods, but on Python 3
    the methods defined in `IEnumerableMapping` already iterate
    without copying.
    cCsdS)z-iterate over keys; equivalent to ``__iter__``Nrrrrr	�iterkeyspszIIterableMapping.iterkeyscCsdS)ziterate over valuesNrrrrr	�
itervaluessszIIterableMapping.itervaluescCsdS)ziterate over itemsNrrrrr	�	iteritemsvszIIterableMapping.iteritemsN)rrr
r�PY2r r!r"rrrr	rfs
rc@seZdZdZdd�ZdS)�IClonableMappingzSSomething that can produce a copy of itself.

    This is available in `dict`.
    cCsdS)zreturn copy of dictNrrrrr	�copyszIClonableMapping.copyN)rrr
rr%rrrr	r$ysr$c@seZdZdZerdd�ZdS)�IExtendedReadMappingz�
    Something with a particular method equivalent to ``__contains__``.

    On Python 2, `dict` provides this method, but it was removed
    in Python 3.
    cCsdS)zCTell if a key exists in the mapping; equivalent to ``__contains__``Nrrrrr	�has_key�szIExtendedReadMapping.has_keyN)rrr
rr#r'rrrr	r&�sr&c@s<eZdZdZdd�Zdd�Zd
dd�Zdd	d
�Zdd�ZdS)�IExtendedWriteMappingzHAdditional mutation methods.

    These are all provided by `dict`.
    cCsdS)zdelete all itemsNrrrrr	�clear�szIExtendedWriteMapping.clearcCsdS)z0 Update D from E: for k in E.keys(): D[k] = E[k]Nr)�drrr	�update�szIExtendedWriteMapping.updateNcCsdS)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in DNrrrrr	�
setdefault�sz IExtendedWriteMapping.setdefaultcCsdS)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)�krrrr	�pop�szIExtendedWriteMapping.popcCsdS)zeremove and return some (key, value) pair as a
        2-tuple; but raise KeyError if mapping is emptyNrrrrr	�popitem�szIExtendedWriteMapping.popitem)N)N)	rrr
rr)r+r,r.r/rrrr	r(�s

r(c@seZdZdZdS)�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``
    Nrrrrr	r0�sr0N)rZzope.interfacerZzope.interface._compatrr#Zzope.interface.commonrrZ
IContainerrrZISizedrrrr$r&r(ZIMutableMappingr0rrrr	�<module>s 
	
�