MCPcopy
hub / github.com/scrapy/scrapy / __getitem__

Method __getitem__

scrapy/http/headers.py:70–74  ·  view source on GitHub ↗
(self, key: AnyStr)

Source from the content-addressed store, hash-verified

68 raise TypeError(f"Unsupported value type: {type(x)}")
69
70 def __getitem__(self, key: AnyStr) -> bytes | None:
71 try:
72 return cast("list[bytes]", super().__getitem__(key))[-1]
73 except IndexError:
74 return None
75
76 def get(self, key: AnyStr, def_val: Any = None) -> bytes | None:
77 try:

Callers 1

getlistMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected