MCPcopy
hub / github.com/scrapy/scrapy / getlist

Method getlist

scrapy/http/headers.py:82–88  ·  view source on GitHub ↗
(self, key: AnyStr, def_val: Any = None)

Source from the content-addressed store, hash-verified

80 return None
81
82 def getlist(self, key: AnyStr, def_val: Any = None) -> list[bytes]:
83 try:
84 return cast("list[bytes]", super().__getitem__(key))
85 except KeyError:
86 if def_val is not None:
87 return self.normvalue(def_val)
88 return []
89
90 def setlist(self, key: AnyStr, list_: Iterable[_RawValue]) -> None:
91 self[key] = list_

Callers 15

appendlistMethod · 0.95
itemsMethod · 0.95
test_basicsMethod · 0.95
test_single_valueMethod · 0.95
test_multivalueMethod · 0.95
test_setdefaultMethod · 0.95
test_updateMethod · 0.95
test_copyMethod · 0.95
test_appendlistMethod · 0.95
test_setlistMethod · 0.95

Calls 2

normvalueMethod · 0.95
__getitem__Method · 0.45

Tested by 15

test_basicsMethod · 0.76
test_single_valueMethod · 0.76
test_multivalueMethod · 0.76
test_setdefaultMethod · 0.76
test_updateMethod · 0.76
test_copyMethod · 0.76
test_appendlistMethod · 0.76
test_setlistMethod · 0.76
test_setlistdefaultMethod · 0.76
test_none_valueMethod · 0.76