U
    ÈZj  ã                   @   s¼   d Z ddlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deeƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
G dd„ deƒZG dd„ de
ee	eƒZdS )zyMapping Interfaces.

Importing this module does *not* mark any standard classes
as implementing any of these interfaces.
é    )Ú	Interfacec                   @   s   e Zd ZdZdd„ ZdS )ÚIItemMappingz%Simplest readable mapping object
    c                 C   s   dS )z`Get a value for a key

        A `KeyError` is raised if there is no value for the key.
        N© ©Úkeyr   r   ú`/var/www/html/TRUCKING_PROJECT/venv/lib/python3.8/site-packages/zope/interface/common/mapping.pyÚ__getitem__   s    zIItemMapping.__getitem__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r      s   r   c                   @   s"   e Zd ZdZddd„Zdd„ ZdS )ÚIReadMappingzBasic mapping interface
    Nc                 C   s   dS )zaGet a value for a key

        The default is returned if there is no value for the key.
        Nr   ©r   Údefaultr   r   r   Úget$   s    zIReadMapping.getc                 C   s   dS )z$Tell if a key exists in the mapping.Nr   r   r   r   r   Ú__contains__*   s    zIReadMapping.__contains__)N)r	   r
   r   r   r   r   r   r   r   r   r       s   
r   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚIWriteMappingz!Mapping methods for changing datac                 C   s   dS )z.Delete a value from the mapping using the key.Nr   r   r   r   r   Ú__delitem__1   s    zIWriteMapping.__delitem__c                 C   s   dS )zSet a new item in the mapping.Nr   )r   Úvaluer   r   r   Ú__setitem__4   s    zIWriteMapping.__setitem__N)r	   r
   r   r   r   r   r   r   r   r   r   .   s   r   c                   @   s8   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ ZdS )ÚIEnumerableMappingz3Mapping objects whose items can be enumerated.
    c                   C   s   dS )z/Return the keys of the mapping object.
        Nr   r   r   r   r   Úkeys<   s    zIEnumerableMapping.keysc                   C   s   dS )z?Return an iterator for the keys of the mapping object.
        Nr   r   r   r   r   Ú__iter__@   s    zIEnumerableMapping.__iter__c                   C   s   dS )z1Return the values of the mapping object.
        Nr   r   r   r   r   ÚvaluesD   s    zIEnumerableMapping.valuesc                   C   s   dS )z0Return the items of the mapping object.
        Nr   r   r   r   r   ÚitemsH   s    zIEnumerableMapping.itemsc                   C   s   dS )z$Return the number of items.
        Nr   r   r   r   r   Ú__len__L   s    zIEnumerableMapping.__len__N)	r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   8   s   r   c                   @   s   e Zd ZdZdS )ÚIMappingz Simple mapping interface N©r	   r
   r   r   r   r   r   r   r   P   s   r   c                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	Ú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.
    c                   C   s   dS )z-iterate over keys; equivalent to ``__iter__``Nr   r   r   r   r   Úiterkeys\   s    zIIterableMapping.iterkeysc                   C   s   dS )ziterate over valuesNr   r   r   r   r   Ú
itervalues_   s    zIIterableMapping.itervaluesc                   C   s   dS )ziterate over itemsNr   r   r   r   r   Ú	iteritemsb   s    zIIterableMapping.iteritemsN)r	   r
   r   r   r   r    r!   r   r   r   r   r   S   s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚIClonableMappingzSSomething that can produce a copy of itself.

    This is available in `dict`.
    c                   C   s   dS )zreturn copy of dictNr   r   r   r   r   Úcopyk   s    zIClonableMapping.copyN)r	   r
   r   r   r#   r   r   r   r   r"   e   s   r"   c                   @   s   e Zd ZdZdd„ ZdS )ÚIExtendedReadMappingzŸ
    Something with a particular method equivalent to ``__contains__``.

    On Python 2, `dict` provides this method, but it was removed
    in Python 3.
    c                 C   s   dS )zCTell if a key exists in the mapping; equivalent to ``__contains__``Nr   r   r   r   r   Úhas_keyv   s    zIExtendedReadMapping.has_keyN)r	   r
   r   r   r%   r   r   r   r   r$   n   s   r$   c                   @   s:   e Zd ZdZdd„ Zdd„ Zddd„Zd	d
„ Zdd„ ZdS )ÚIExtendedWriteMappingzHAdditional mutation methods.

    These are all provided by `dict`.
    c                   C   s   dS )zdelete all itemsNr   r   r   r   r   Úclear   s    zIExtendedWriteMapping.clearc                 C   s   dS )z0 Update D from E: for k in E.keys(): D[k] = E[k]Nr   )Údr   r   r   Úupdate‚   s    zIExtendedWriteMapping.updateNc                 C   s   dS )z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in DNr   r   r   r   r   Ú
setdefault…   s    z IExtendedWriteMapping.setdefaultc                 G   s   dS )zéRemove specified key and return the corresponding value.

        ``*args`` may contain a single default value, or may not be supplied.
        If key is not found, default is returned if given, otherwise
        `KeyError` is raisedNr   )ÚkÚargsr   r   r   Úpopˆ   s    zIExtendedWriteMapping.popc                   C   s   dS )zeremove and return some (key, value) pair as a
        2-tuple; but raise KeyError if mapping is emptyNr   r   r   r   r   Úpopitem�   s    zIExtendedWriteMapping.popitem)N)	r	   r
   r   r   r'   r)   r*   r-   r.   r   r   r   r   r&   y   s   
r&   c                   @   s   e Zd ZdZdS )ÚIFullMappingz Full mapping interface Nr   r   r   r   r   r/   “   s   r/   N)r   Zzope.interfacer   r   r   r   r   r   r   r"   r$   r&   r/   r   r   r   r   Ú<module>   s    
	
   ÿ