zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
U
¡ý°d` ã@sDdZddlmZddlmZmZGdd„deƒZGdd„deƒZd    S)
zO
requests.structures
~~~~~~~~~~~~~~~~~~~
 
Data structures that power Requests.
é)Ú OrderedDicté)ÚMappingÚMutableMappingc@sbeZdZdZddd„Zdd„Zdd„Zd    d
„Zd d „Zd d„Z    dd„Z
dd„Z dd„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 úJd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\requests/structures.pyÚ__init__(szCaseInsensitiveDict.__init__cCs||f|j| ¡<dSr©rÚlower)r
ÚkeyÚvaluer r rÚ __setitem__.szCaseInsensitiveDict.__setitem__cCs|j| ¡dS)Nrr©r
rr r rÚ __getitem__3szCaseInsensitiveDict.__getitem__cCs|j| ¡=dSrrrr r rÚ __delitem__6szCaseInsensitiveDict.__delitem__cCsdd„|j ¡DƒS)Ncss|]\}}|VqdSrr )Ú.0ÚcasedkeyÚ mappedvaluer r rÚ    <genexpr>:sz/CaseInsensitiveDict.__iter__.<locals>.<genexpr>)rÚvalues©r
r r rÚ__iter__9szCaseInsensitiveDict.__iter__cCs
t|jƒSr)Úlenrrr r rÚ__len__<szCaseInsensitiveDict.__len__cCsdd„|j ¡DƒS)z.Like iteritems(), but with all lowercase keys.css|]\}}||dfVqdS)rNr )rÚlowerkeyÚkeyvalr r rrAsz2CaseInsensitiveDict.lower_items.<locals>.<genexpr>)rÚitemsrr r rÚ lower_items?szCaseInsensitiveDict.lower_itemscCs0t|tƒrt|ƒ}ntSt| ¡ƒt| ¡ƒkSr)Ú
isinstancerrÚNotImplementedÚdictr$)r
Úotherr r rÚ__eq__Cs
 
zCaseInsensitiveDict.__eq__cCst|j ¡ƒSr)rrrrr r rÚcopyLszCaseInsensitiveDict.copycCstt| ¡ƒƒSr)Ústrr'r#rr r rÚ__repr__OszCaseInsensitiveDict.__repr__)N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrrrr r$r)r*r,r r r rr s
    rcs<eZdZdZd ‡fdd„    Zdd„Zdd„Zd d    d
„Z‡ZS) Ú
LookupDictzDictionary lookup object.Ncs||_tƒ ¡dSr)ÚnameÚsuperr)r
r2©Ú    __class__r rrVszLookupDict.__init__cCsd|j›dS)Nz    <lookup 'z'>)r2rr r rr,ZszLookupDict.__repr__cCs|j |d¡Sr©Ú__dict__Úgetrr r rr]szLookupDict.__getitem__cCs|j ||¡Srr6)r
rÚdefaultr r rr8bszLookupDict.get)N)N)    r-r.r/r0rr,rr8Ú __classcell__r r r4rr1Ss
r1N)    r0Ú collectionsrÚcompatrrrr'r1r r r rÚ<module>s F