Edit File: structures.cpython-36.opt-1.pyc
3 ��[�������������������@���s<���d�Z�ddlmZmZmZ�G�dd��de�ZG�dd��de�ZdS�)zO requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. ����)�OrderedDict�Mapping�MutableMappingc���������������@���sb���e�Zd�ZdZddd�Zdd��Zdd��Zd d ��Zdd��Zd d��Z dd��Z dd��Zdd��Zdd��Z dS�)�CaseInsensitiveDicta���A case-insensitive ``dict``-like object. Implements all methods and operations of ``MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive:: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. Nc�������������K���s&���t���|�_|d�kri�}|�j|f|��d�S�)N)r����_store�update)�self�data�kwargs��r���� /usr/lib/python3.6/structures.py�__init__(���s����zCaseInsensitiveDict.__init__c�������������C���s���||f|�j�|j��<�d�S�)N)r����lower)r����key�valuer���r���r����__setitem__.���s����zCaseInsensitiveDict.__setitem__c�������������C���s���|�j�|j���d�S�)Nr���)r���r���)r���r���r���r���r����__getitem__3���s����zCaseInsensitiveDict.__getitem__c�������������C���s���|�j�|j��=�d�S�)N)r���r���)r���r���r���r���r����__delitem__6���s����zCaseInsensitiveDict.__delitem__c�������������C���s���dd��|�j�j��D��S�)Nc�������������s���s���|�]\}}|V��qd�S�)Nr���)�.0ZcasedkeyZmappedvaluer���r���r���� <genexpr>:���s����z/CaseInsensitiveDict.__iter__.<locals>.<genexpr>)r����values)r���r���r���r����__iter__9���s����zCaseInsensitiveDict.__iter__c�������������C���s ���t�|�j�S�)N)�lenr���)r���r���r���r����__len__<���s����zCaseInsensitiveDict.__len__c�������������C���s���dd��|�j�j��D��S�)z.Like iteritems(), but with all lowercase keys.c�������������s���s���|�]\}}||d��fV��qdS�)r���Nr���)r���ZlowerkeyZkeyvalr���r���r���r���B���s���z2CaseInsensitiveDict.lower_items.<locals>.<genexpr>)r����items)r���r���r���r����lower_items?���s����zCaseInsensitiveDict.lower_itemsc�������������C���s0���t�|t�rt|�}ntS�t|�j���t|j���kS�)N)� isinstancer���r����NotImplemented�dictr���)r����otherr���r���r����__eq__G���s���� zCaseInsensitiveDict.__eq__c�������������C���s���t�|�jj���S�)N)r���r���r���)r���r���r���r����copyP���s����zCaseInsensitiveDict.copyc�������������C���s���t�t|�j����S�)N)�strr���r���)r���r���r���r����__repr__S���s����zCaseInsensitiveDict.__repr__)N)�__name__� __module__�__qualname__�__doc__r ���r���r���r���r���r���r���r ���r!���r#���r���r���r���r���r��� ���s��� r���c�������������������s<���e�Zd�ZdZd��fdd� Zdd��Zdd��Zdd d �Z���ZS�) � LookupDictzDictionary lookup object.Nc����������������s���||�_�tt|��j���d�S�)N)�name�superr(���r ���)r���r)���)� __class__r���r���r ���Z���s����zLookupDict.__init__c�������������C���s ���d|�j��S�)Nz <lookup '%s'>)r)���)r���r���r���r���r#���^���s����zLookupDict.__repr__c�������������C���s���|�j�j|d��S�)N)�__dict__�get)r���r���r���r���r���r���a���s����zLookupDict.__getitem__c�������������C���s���|�j�j||�S�)N)r,���r-���)r���r����defaultr���r���r���r-���f���s����zLookupDict.get)N)N) r$���r%���r&���r'���r ���r#���r���r-���� __classcell__r���r���)r+���r���r(���W���s ���r(���N)r'����compatr���r���r���r���r���r(���r���r���r���r����<module>���s���J