Your IP : 3.12.153.240


Current Path : /opt/alt/python37/lib/python3.7/site-packages/requests/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/requests/__pycache__/structures.cpython-37.pyc

B

0��_��@sDdZddlmZddlmZmZGdd�de�ZGdd�de�Zd	S)
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�D/opt/alt/python37/lib/python3.7/site-packages/requests/structures.py�__init__*szCaseInsensitiveDict.__init__cCs||f|j|��<dS)N)r�lower)r	�key�valuerrr
�__setitem__0szCaseInsensitiveDict.__setitem__cCs|j|��dS)Nr)rr)r	rrrr
�__getitem__5szCaseInsensitiveDict.__getitem__cCs|j|��=dS)N)rr)r	rrrr
�__delitem__8szCaseInsensitiveDict.__delitem__cCsdd�|j��D�S)Ncss|]\}}|VqdS)Nr)�.0ZcasedkeyZmappedvaluerrr
�	<genexpr><sz/CaseInsensitiveDict.__iter__.<locals>.<genexpr>)r�values)r	rrr
�__iter__;szCaseInsensitiveDict.__iter__cCs
t|j�S)N)�lenr)r	rrr
�__len__>szCaseInsensitiveDict.__len__cCsdd�|j��D�S)z.Like iteritems(), but with all lowercase keys.css|]\}}||dfVqdS)rNr)rZlowerkeyZkeyvalrrr
rDsz2CaseInsensitiveDict.lower_items.<locals>.<genexpr>)r�items)r	rrr
�lower_itemsAszCaseInsensitiveDict.lower_itemscCs0t|t�rt|�}ntSt|���t|���kS)N)�
isinstancerr�NotImplemented�dictr)r	�otherrrr
�__eq__Is

zCaseInsensitiveDict.__eq__cCst|j���S)N)rrr)r	rrr
�copyRszCaseInsensitiveDict.copycCstt|����S)N)�strrr)r	rrr
�__repr__UszCaseInsensitiveDict.__repr__)N)�__name__�
__module__�__qualname__�__doc__rrrrrrrr!r"r$rrrr
rs
	rcs<eZdZdZd�fdd�	Zdd�Zdd�Zdd	d
�Z�ZS)
�
LookupDictzDictionary lookup object.Ncs||_tt|���dS)N)�name�superr)r)r	r*)�	__class__rr
r\szLookupDict.__init__cCs
d|jS)Nz
<lookup '%s'>)r*)r	rrr
r$`szLookupDict.__repr__cCs|j�|d�S)N)�__dict__�get)r	rrrr
rcszLookupDict.__getitem__cCs|j�||�S)N)r-r.)r	r�defaultrrr
r.hszLookupDict.get)N)N)	r%r&r'r(rr$rr.�
__classcell__rr)r,r
r)Ys
r)N)	r(�collectionsr�compatrrrrr)rrrr
�<module>sJ

?>