Your IP : 18.219.127.59


Current Path : /usr/lib/python3.6/site-packages/requests/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/requests/__pycache__/structures.cpython-36.opt-1.pyc

3

��[��@s<dZddlmZmZmZGdd�de�ZGdd�de�ZdS)zO
requests.structures
~~~~~~~~~~~~~~~~~~~

Data structures that power Requests.
�)�OrderedDict�Mapping�MutableMappingc@sbeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�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.
    NcKs&t�|_|dkri}|j|f|�dS)N)r�_store�update)�self�data�kwargs�r� /usr/lib/python3.6/structures.py�__init__(szCaseInsensitiveDict.__init__cCs||f|j|j�<dS)N)r�lower)r�key�valuerrr�__setitem__.szCaseInsensitiveDict.__setitem__cCs|j|j�dS)Nr)rr)rrrrr�__getitem__3szCaseInsensitiveDict.__getitem__cCs|j|j�=dS)N)rr)rrrrr�__delitem__6szCaseInsensitiveDict.__delitem__cCsdd�|jj�D�S)Ncss|]\}}|VqdS)Nr)�.0ZcasedkeyZmappedvaluerrr�	<genexpr>:sz/CaseInsensitiveDict.__iter__.<locals>.<genexpr>)r�values)rrrr�__iter__9szCaseInsensitiveDict.__iter__cCs
t|j�S)N)�lenr)rrrr�__len__<szCaseInsensitiveDict.__len__cCsdd�|jj�D�S)z.Like iteritems(), but with all lowercase keys.css|]\}}||dfVqdS)rNr)rZlowerkeyZkeyvalrrrrBsz2CaseInsensitiveDict.lower_items.<locals>.<genexpr>)r�items)rrrr�lower_items?szCaseInsensitiveDict.lower_itemscCs0t|t�rt|�}ntSt|j��t|j��kS)N)�
isinstancerr�NotImplemented�dictr)r�otherrrr�__eq__Gs

zCaseInsensitiveDict.__eq__cCst|jj��S)N)rrr)rrrr�copyPszCaseInsensitiveDict.copycCstt|j���S)N)�strrr)rrrr�__repr__SszCaseInsensitiveDict.__repr__)N)�__name__�
__module__�__qualname__�__doc__r
rrrrrrr r!r#rrrrr
s
	rcs<eZdZdZd�fdd�	Zdd�Zdd�Zdd	d
�Z�ZS)
�
LookupDictzDictionary lookup object.Ncs||_tt|�j�dS)N)�name�superr(r
)rr))�	__class__rrr
ZszLookupDict.__init__cCs
d|jS)Nz
<lookup '%s'>)r))rrrrr#^szLookupDict.__repr__cCs|jj|d�S)N)�__dict__�get)rrrrrraszLookupDict.__getitem__cCs|jj||�S)N)r,r-)rr�defaultrrrr-fszLookupDict.get)N)N)	r$r%r&r'r
r#rr-�
__classcell__rr)r+rr(Ws
r(N)r'�compatrrrrrr(rrrr�<module>sJ

?>