MCPcopy
hub / github.com/scrapy/scrapy / to_tuple_list

Method to_tuple_list

scrapy/http/headers.py:127–136  ·  view source on GitHub ↗

Return headers as a list of ``(key, value)`` tuples. Multiple values are represented as multiple tuples with the same key.

(self)

Source from the content-addressed store, hash-verified

125 )
126
127 def to_tuple_list(self) -> list[tuple[str, str]]:
128 """Return headers as a list of ``(key, value)`` tuples.
129
130 Multiple values are represented as multiple tuples with the same key.
131 """
132 return [
133 (key.decode(self.encoding), value.decode(self.encoding))
134 for key, values in self.items()
135 for value in values
136 ]
137
138 def __copy__(self) -> Self:
139 return self.__class__(self)

Callers 1

_make_requestMethod · 0.80

Calls 1

itemsMethod · 0.95

Tested by

no test coverage detected