MCPcopy
hub / github.com/scrapy/scrapy / update

Method update

scrapy/http/headers.py:34–41  ·  view source on GitHub ↗
(  # type: ignore[override]
        self, seq: Mapping[AnyStr, Any] | Iterable[tuple[AnyStr, Any]]
    )

Source from the content-addressed store, hash-verified

32 super().__init__(seq)
33
34 def update( # type: ignore[override]
35 self, seq: Mapping[AnyStr, Any] | Iterable[tuple[AnyStr, Any]]
36 ) -> None:
37 seq = seq.items() if isinstance(seq, Mapping) else seq
38 iseq: dict[bytes, list[bytes]] = {}
39 for k, v in seq:
40 iseq.setdefault(self.normkey(k), []).extend(self.normvalue(v))
41 super().update(iseq)
42
43 def normkey(self, key: AnyStr) -> bytes: # type: ignore[override]
44 """Normalize key to bytes"""

Callers 9

test_updateMethod · 0.95
_get_commands_dictFunction · 0.45
__init__Method · 0.45
from_curlMethod · 0.45
prepare_requestMethod · 0.45
_md5sumFunction · 0.45
persist_fileMethod · 0.45
__init__Method · 0.45

Calls 5

normkeyMethod · 0.95
normvalueMethod · 0.95
itemsMethod · 0.80
extendMethod · 0.45
setdefaultMethod · 0.45

Tested by 1

test_updateMethod · 0.76