3 [ @ s d Z ddlmZ G dd deZG dd deZG dd deZG d d d eZG dd deeZG d d deZG dd deZ G dd deZ G dd deZG dd de ee eZdS )zyMapping Interfaces. Importing this module does *not* mark any standard classes as implementing any of these interfaces. ) Interfacec @ s e Zd ZdZdd ZdS )IItemMappingz%Simplest readable mapping object c C s dS )z`Get a value for a key A `KeyError` is raised if there is no value for the key. N )keyr r /usr/lib64/python3.6/mapping.py__getitem__ s zIItemMapping.__getitem__N)__name__ __module____qualname____doc__r r r r r r s r c @ s" e Zd ZdZdddZdd ZdS )IReadMappingzBasic mapping interface Nc C s dS )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 zIReadMapping.getc C s dS )z$Tell if a key exists in the mapping.Nr )r r r r __contains__* s zIReadMapping.__contains__)N)r r r r r r r r r r r s r c @ s e Zd ZdZdd Zdd ZdS ) IWriteMappingz!Mapping methods for changing datac C s dS )z.Delete a value from the mapping using the key.Nr )r r r r __delitem__1 s zIWriteMapping.__delitem__c C s dS )zSet a new item in the mapping.Nr )r valuer r r __setitem__4 s zIWriteMapping.__setitem__N)r r r r r r r r r r r . s r c @ s8 e Zd ZdZdd Zdd Zdd Zdd Zd d ZdS ) IEnumerableMappingz3Mapping objects whose items can be enumerated. c C s dS )z/Return the keys of the mapping object. Nr r r r r keys<