MCPcopy
hub / github.com/encode/httpx / to_bytes_or_str

Function to_bytes_or_str

httpx/_utils.py:87–88  ·  view source on GitHub ↗
(value: str, match_type_of: typing.AnyStr)

Source from the content-addressed store, hash-verified

85
86
87def to_bytes_or_str(value: str, match_type_of: typing.AnyStr) -> typing.AnyStr:
88 return value if isinstance(match_type_of, str) else value.encode()
89
90
91def unquote(value: str) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected